Is there a standardized method to swap two variables in Python?

Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side. Python docs: Evaluation order That means the following for the expression a,b = b,a : The right-hand side b,a is evaluated, that is to say, a tuple of two elements is created in … Read more