In this Python basic program, we will interchange values between variables.
Steps to solve the program
- Take two variables as input and assign value to them.
- Interchange their values using “, = “.
- Print the variables after interchanging the values.
Program:
a = 50
b = 70
a, b = b, a
print("value of a :", a)
print("value of b :", b)
Output:
value of a : 70
value of b : 50