Swap the values of two variables

# Swap the values of two variables

num1 = int(input("Enter a number : "))
num2 = int(input("Enter a number : "))

print("Values of variables before swap :")
print("Number 1 :",num1)
print("Number 2 :",num2)

num1, num2 = num2, num1

print("Values of variables before swap :")
print("Number 1 :",num1)
print("Number 2 :",num2)

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu