Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import functools
- @functools.lru_cache()
- def fib(iterations):
- a, b = 0, 1
- for _ in range(iterations):
- a, b = b, a+b
- return a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement