Hello all,
I have started an new project which needs a Fibonacci sequence (all Fibonacci numbers below 4,000,000)
Here is my code for calculating Fibonacci numbers:
numbers_list = []
number1 = 1
number2 = 2
total = 0
while (total < 4000000):
total = number1 + number2
number1 = number2
number2 = total
numbers_list.append (total)
listlength = len(numbers_list)
print (numbers_list)
I know it produces an ugly result (I will work on that soon), but it also outputs one number above 4,000,000 (5702887)
Why does it display this number?
Any help greatly appreciated