Source Code:
(back to article)
x = 5 y = 10 # Before swapping print("Before swapping") print("x =", x) print("y =", y) # Swapping variables x, y = y, x # After swapping print("After swapping") print("x =", x) print("y =", y)
Result:
Report an issue