Im trying to write a program that displays the FIBONACCI NUMBERS, however, the numbers don't print out correctly and are always one number too high for what the Fibonacci number is meant to be, can anyone understand why?
This is the code i have:
a, b = 0, 1
while b < 1000:
print(b, '', end='')
a, b = b, a + b
(have to use those 4 lines of code)
And this is the output I get
1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
and this is the output im looking for 0 1 2 4 7 12 20 33 54
the program should also start at 0 not 1