What is the difference between the following Python expressions:
# First: x,y = y,x+y # Second: x = y y = x+y
First gives diffe
The first one is a tuple-like assignment:
x,y = y,x+y
Where x is the first element of the tuple, and y is the second element, thus what you are doing is:
x
y
x = y y = x+y
Wheras the second is doing a straight assign:
x=y x=x+y