Home Blogs 2 Wikis 34
Wikis

Fibonacci coding

July 6, 2022 - Reading time: ~1 minute

Implementation

In [1]: 


import functools

@functools.cache
def fib(n):
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)
Read more

About

Thanks for checking out my website. You can read my blogs & wikis and inspect my cv in here also you can look at my projects too.

Hit Counter

1302