0
Need help on Python 3 Module 7 Project
Hi, I'm having trouble with the Fibonacci project. My code is below, but it doesn't return what I want at all. If you could give me some advice for how to fix this or a different strategy I should try, that would be great. num = int(input()) fibs = [i for i in range (num)] def fibonacci(n, x): if x < n: if x == 0: print(0) elif x == 1: print(1) else: fibs[x] = (fibs[(n-1)] + fibs[(n-2)]) print(fibs[x]) return fibonacci(n-1, x+1) fibonacci(num, 0)
5 Respuestas
0
What is fibs?
0
Thanks Abol! That answer was very close to correct, and I was able to figure it out.