Here I am going to
explain how we can swap 2 numbers without using 3rd variable.
Step
1: Open IDLE(Python
GUI) in your system.
Step 2 :
Type
the Below code and save the code Eg:- I have saved with swap name.
a = 8
b = 7
print("the
value for 1st variable is",a)
print("the value for 2nd variable is",b)
a = a+b
b = a-b
a = a-b
print("the
value after swaping 1st variable is",a)
print("the value after swaping 2nd variable is",b)
Step 3 : Open command prompt.
Step
4 : Go to the saved script folder.
Step
5 : Write python <Script name>.py for
execution.(Eg.- python swap.py)

Image 1.