Practice ยท 3 of 3
Tuple Swap Trick
a = 1 and b = 2 are given. Swap them WITHOUT a temp variable โ Python's tuple assignment: a, b = b, a. Print a then b.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Tuples & Sets