a,b = b,a
What does it actually do?
Well, it swaps a and b.. the question is how?
Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.
In the above line of code, two new objects are created which are reference the same object as b, a respectively. Then, we assign them to a,b. The left side will get assigned first, that is a.