This code will not run! Given that the first two Fibonacci numbers are 0 and 1, what do you
think you should put in the
first = and
second = lines? After this, the next
Fibonacci number is 3, which is the sum of
first and
second. So, what should you put
in for the
next = line?
Your code is working with it displays this sequence of numbers:
0, 1, 2, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ...
Not the logic: the old second number becomes the new first number. And the current number becomes the new second number,
so the next time through the loop, the next number can be found buy adding the first and second once again.