In python a,b=b,a
( python ) a,b = b,a
X,y=2,3 Print(y,X)
Next step swap without using the third variable: b=a+b a=b-a b=b-a Ex: a=10 b=25 b=a+b (a=10,b=35) a=b-a (a=25,b=35) b=b-a (a=25,b=10)
Ex: A=10 B=14 A=A+B #24 B=A-B # 24-14=10 A=A-B # 24-10=14 Without using third element
Using temp variable called C
Doubt cleared ❤👍
We can use ,
Temp=a, b=a,a=temp
Temp = a a = b b = temp
x, y = 5, 10 x, y = y, x print("x =", x) print("y =", y) 🎉🎉
We can use third variables to swap
Thanks broo 👍
A=temp , A=B, B=temp
Bravo bro❤🎉
a,b=b,a
Bro can you please explain javascript promises concept
We can use pointers without using a temp variable
A=10 B=5 A,b=b,A Print(a) Print(b)
@kishore3484