- Get link
- X
- Other Apps
Posted by
Naveen M K
on
- Get link
- X
- Other Apps
Swap values of two Variables-using third variable
Coding:
#Swap values of two Variables-using third
a=input("Enter variable 'a' ")
b=input("Enter variable 'b'")
c=a
a=b
b=c
print("Variables shifted",a,b,sep='\n')
This will variables using the classic method. Shifting a variable requires the creation of a third variable. This uses that method.
Related post:
Swap values of two Variables- Without using third
https://blog.syrusdark.website/2019/12/swap-values-of-two-variables-without.html
https://blog.syrusdark.website/2019/12/swap-values-of-two-variables-without.html
Comments
Post a Comment