how to make two variables exchange values code example
Example 1: swapping in python
x = 5
y = 10
x, y = y, x
print("x =", x)
print("y =", y)
Example 2: swap 2 no in one line python
a, b = b, a
x = 5
y = 10
x, y = y, x
print("x =", x)
print("y =", y)
a, b = b, a