Advertisement
tyler569

fibonacci stored

Jul 28th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import functools
  2. @functools.lru_cache()
  3. def fib(iterations):
  4.     a, b = 0, 1
  5.     for _ in range(iterations):
  6.         a, b = b, a+b
  7.     return a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement