Skip to content

Instantly share code, notes, and snippets.

@smith0022
Created April 4, 2021 08:19
Show Gist options
  • Save smith0022/c052b1b9cc8bf9f861d8f7fdba15b7ee to your computer and use it in GitHub Desktop.
Save smith0022/c052b1b9cc8bf9f861d8f7fdba15b7ee to your computer and use it in GitHub Desktop.
it code using recursive programming to find fibnocci series
def fast_fib(n,memo):
if n==1 or n==2:
return 1
try:
return memo[n]
except:
final=fast_fib(n-1,memo)+fast_fib(n-2,memo)
memo[n]=final
return final
print(fast_fib(3,{}))
print(fast_fib(8,{}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment