Search This Blog

Monday, September 17, 2018

How to exchange values in Python

x, y = 10, 20
print(x, y)

x, y = y, x
print(x, y)

#1 (10, 20)
#2 (20, 10)