Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattjmorrison/863203 to your computer and use it in GitHub Desktop.
Save mattjmorrison/863203 to your computer and use it in GitHub Desktop.
from functools import lru_cache
@lru_cache()
def fibonacci(n):
global _count
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
print(fibonacci(120))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment