Any tips on this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Any tips on this?

I couldn't understand the Fibonacci because I couldn't find a way to add it. If the input was 5 And the output is like this >>> 0 1 1 2 3 How can I use recursion function in this one?

8th Oct 2022, 2:52 PM
Iamno0v
Iamno0v - avatar
1 Answer
+ 1
Your function: f(n) = f(n-1) + f(n-2) base cases: if n == 0: return 0 if n == 1: return 1 Hope this helps.
8th Oct 2022, 3:49 PM
Denise Roßberg
Denise Roßberg - avatar