Python | Variables Quiz | Question 5

Last Updated :
Discuss
Comments

How do you swap the values of two variables in Python without using a third variable?

 x = y; y = x

x, y = y, x

temp = x; x = y; y = temp

x + y; y = x; x = y

Share your thoughts in the comments