Python By Code
Showing posts with label
swap variables
.
Show all posts
Showing posts with label
swap variables
.
Show all posts
Wednesday, July 8, 2015
Swap using 2 variables
a=input("Enter a")
b=input("Enter b")
a=a+b
b=a-b
a=a-b
print a
print b
Swap using 3 variables
a=input("Enter a")
b=input("Enter b")
c=a
a=b
b=c
print a
print b
Older Posts
Home
Subscribe to:
Posts (Atom)