swap numbers without taking third variable in Python
Question:-
How can we write a program to swap two numbers without using a third variable in Python?
swap numbers without taking third variable in Python
swaping is very simple in python in comparison to others language.
Let’s see directly it’s an example of it because it will clear everything after program.
Example :-
- x, y= 10, 12
- x, y= y, x
- print(x,y)
Comments
Post a Comment