What is the difference between the following Python expressions:
# First: x,y = y,x+y # Second: x = y y = x+y
First gives diffe
a, b = 0, 1 while b < 10: print(b) a, b = b, a+b
Output
1 1 2 3 5 8
the variables a and b simultaneously get the new values 0 and 1, the same a, b = b, a+b, a and b are assigned simultaneously.
a
b
0
1
a, b = b, a+b