Stylish Progress Bar For Sketchware

Swap values of two Variables-Without using third

Swap values of two Variables-Without using third in Python

Swap values of two Variables-Without using third

Coding


#Swap values of two Variables-Without using third
a=input("Enter variable 'a' ")
b=input("Enter variable 'b'")
a,b=b,a  #can be done only in python
print("Variables shifted",a,b,sep='\n')

This is Python-specific method and can't be used in other languages. This swap variable 'a' and 'b'.

Related post: 

Comments

This Blog is protected by DMCA.com

Donate Me

Donate Me
Do something Great