LogiQuest
Back to Lambda and Functional Tools
19

What is the output of the following code?

from functools import lru_cache
@lru_cache
def fib(n):
    return n if n < 2 else fib(n - 1) + fib(n - 2)
print(fib(30))
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.