I need to make a program that asks for the amount of Fibonacci numbers printed and then prints them like 0, 1, 1, 2... but I can\'t get it to work. My code looks the followi
Also you can try the closed form solution (no guarantees for very large values of n due to rounding/overflow errors):
root5 = pow(5, 0.5) ratio = (1 + root5)/2 def fib(n): return int((pow(ratio, n) - pow(1 - ratio, n))/root5)