Program to swap the values of two variables

# Swap Two Variables
a = input("Enter the value of a: ")
b = input("Enter the value of b: ")

# Swapping
a, b = b, a

print("After swapping, value of a:", a)
print("After swapping, value of b:", b)
Output:
Enter the value of a: 5
Enter the value of b: 10
After swapping, value of a: 10
After swapping, value of b: 5

Leave a Reply

Your email address will not be published. Required fields are marked *