How to Swap Two Variables in Python

a = 5
b = 10
a, b = b, a
print(f"After swapping: a = {a}, b = {b}")

Leave a Comment

Your email address will not be published.