This is the easy and coolest way to swap two numbers in python,
a = 0
b = 1
print a,b
#output 0 1
> 0
#One liner code to swap two numbers
a,b = b,a
print a,b
#output 1 0
A technology and programming blog to share knowledge and solutions to problems came across
Comments
Post a Comment