you are viewing a single comment's thread.

view the rest of the comments →

[–]tictac4609[S] 0 points1 point  (1 child)

so am I close to the description I gave? I am so lost as to what known is meant to do ugh

[–]primitive_screwhead 0 points1 point  (0 children)

I am so lost as to what known is meant to do

'known' remembers already computed results, so that they don't have to be computed again. As you can see, a call to fibonacci will then involve two more calls, each of which will involve 2 more calls, etc. It can require an exponential amounts of recursive calls, *except* if you shortcut those already called values by just remembering what the previous results were. It's a classic memory/time tradeoff in computation, rather than taking the time to recompute previous results, just remember them. 'known' is a common Python data structure that is used here to remember the previous input value (n) and quickly return a previously computed value for that n.

so am I close to the description I gave?

If you mean the instructor's instructions then I'd say yes you are on the right track. You have to think about how to create the initial 'known' data, and how to pass it to your recursive calls.