Write a program in Python to swap two numbers without using third variable?

Madhan Umk
Oct 31, 2023

--

a = 10
b = 12
a,b = b,a
print(a,b)

#Result
12 10
Swap two numbers without using third variable in Python
Swap two numbers without using third variable in Python

--

--

Madhan Umk
Madhan Umk

Written by Madhan Umk

90's Kid | Travel Blogger | #lyriclens | Photophile | Founder @lifeliker_in 🪄

Responses (1)