Skip to content

Instantly share code, notes, and snippets.

@GammaGames
Created June 15, 2018 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GammaGames/10506713480af9c7b5f94ce2b61fd804 to your computer and use it in GitHub Desktop.
Save GammaGames/10506713480af9c7b5f94ce2b61fd804 to your computer and use it in GitHub Desktop.
python3 fib
from functools import lru_cache
@lru_cache(None)
def fib(n):
return n if n < 2 else fib(n-1) + fib(n-2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment