I’m on my own, trying to learn Python from a book. I write a simple code snippet to sum Fibonacci numbers up to 100 as follows:

a, b, sum_of_fibs = 0, 1, 0

while b < 100:

sum_of_fibs += b

c = b # temp store b

b = a + b # get next fib no.

a = c # new a = previous b

print(“sum of Fibonacci numbers < 100 =”,sum_of_fibs)

Clear to me and it generates the correct sum, 232.

However, I found that someone has written the essential algorithm as follows (same 1st & last lines):

while b < 100:

sum_of_fibs += b

a, b=b, a+b

This works too, but I do not understand that 3rd line. (“a” standing alone? b = b? seems very strange)

Can someone kindly explain this syntax and what is going on here?

Thanks very much.