So the code is
def mystery(n):
a, b = 0, 1
while (a < n):
print(a)
a, b = b, a + b
The bit I do not understand very well is how a, b = b, a + b works. It seems really difficult to understand for me. I struggle to comprehend how variables work with listing involved. Could someone shed some light on what sequence is being produced and how the numbers tally up.
The sequence is meant to go
0
1
1
2
3
5
8
13
21
34
etc
I would be really greatful, thanks in advance!