← Back to Question List
Python Code Walkthrough #48
How Many Times Fib Is Called
📄 Code
Read carefully — what does this print?1counter: dict[str, int] = {"calls": 0}23def fib(n: int) -> int:4 counter["calls"] = counter["calls"] + 15 if n < 2:6 return n7 return fib(n - 1) + fib(n - 2)89print(fib(5))10print(counter["calls"])