This is my first question and I started to learn Python. Is there a difference between:
a, b = b, a + b
and
a = b
b = a + b
When you write it in below example it shows different results.
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a + b
print()
fib(1000)
and
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a = b
b = a + b
print()
fib(1000)
See Question&Answers more detail:os