tyler569 icon

fibonacci stored

tyler569 | PRO | 07/28/18 05:26:02 AM UTC | 0 ⭐ | 812 👁️ | Never ⏰ | []
Python |

130 B

|

None

|

0 👍

/

0 👎

import functools
@functools.lru_cache()
def fib(iterations):
    a, b = 0, 1
    for _ in range(iterations):
        a, b = b, a+b
    return a

Comments