One pointer goes at the start of the list and one at the end, and they walk toward each other. Only one moves at each step; you decide which by looking at where things stand.
lo, hi = 0, len(values) - 1while lo < hi:total = values[lo] + values[hi]if total == key:return Trueif total < key:lo += 1else:hi -= 1return False
A palindrome check is the same walk: are the elements at the two ends equal, and if so both step in. When they meet in the middle, it is done.