how can I write a code for Fibonacci sequence up to 100? please help me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how can I write a code for Fibonacci sequence up to 100? please help me.

14th Jul 2016, 11:32 AM
Michael Ansah
Michael Ansah - avatar
2 Answers
14th Jul 2016, 12:13 PM
Gershon Fosu
Gershon Fosu - avatar
0
You can use a dictionary to cache previous values. If you don't and you are using a recursive function, then you will wait a long time for anything over 30. See my example code at http://www.sololearn.com/app/JUMP_LINK__&&__python__&&__JUMP_LINK/playground/cAeZvpBgh0ES/
14th Jul 2016, 1:24 PM
Doug Irvine
Doug Irvine - avatar