Python Swap Variables: Quick Guide
You can exchange the values of a and b by using the following method:
a = 10
b = 20
a, b = b, a
print("a =", a)
print("b =", b)
This allows for exchanging the values of a and b, with the final output result being:
a = 20
b = 10