One pass does not have to carry a single value. To find the second largest you hold two variables: the largest and the one after it.
best = second = float("-inf")for v in values:if v > best:best, second = v, bestelif v > second:second = vreturn second
a, b = x, y changes two variables at once; the right side is worked out with the values from before the assignment.float("-inf") is a starting value smaller than every number. It helps where you cannot start from the list's first element (two variables, one first element).