Swap variables without temporary variables
Normally, variables can be swapped with temporary variables.
tmp = a a = b b = tmp
In Python, with a tuple,
a, b = b, a
Normally, variables can be swapped with temporary variables.
tmp = a a = b b = tmp
In Python, with a tuple,
a, b = b, a