Python Program to swap two numbers using temporary variable

Program

a = int(input("Enter the value of a\n"))
b = int(input("Enter the value of b\n"))
print("Values before swapping:")
print("a: {}\nb: {}\n".format(a,b))
temp = a
a = b
b = temp
print("Values after swapping:")
print("a: {}\nb: {}".format(a,b))

Output

Enter the value of a
7
Enter the value of b
4
Values before swapping:
a: 7
b: 4
Values after swapping:
a: 4
b: 7