Swap 2 values of 2 variables without using a third variable; python
So, a friend of mine asked how my python programming was coming; I said I was learning a lot and that it was coming along nicely. Then my friend, a math-snob, asks me: "Can you swap the value of 2 variables without using a third variable as a temporary placeholder?" Sylvain Leroux The canonical way to swap two variables in Python is a, b = b, a Please note than this is valid whatever the "type" of a or b is (numeric, string, tuple, object, ...). Of course, it works too if both variables reference values of different types. As many imperative languages, Python evaluates assignments right to