From 41e0e6e027e42340b603bf1b6a40df2c54668787 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Thu, 9 Apr 2026 10:02:45 -0700 Subject: [PATCH] Update Fibonacci example --- shared/notes-and-examples/2026.04.08/function_stack.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared/notes-and-examples/2026.04.08/function_stack.py b/shared/notes-and-examples/2026.04.08/function_stack.py index 0721d89..41845f4 100644 --- a/shared/notes-and-examples/2026.04.08/function_stack.py +++ b/shared/notes-and-examples/2026.04.08/function_stack.py @@ -9,4 +9,12 @@ def fibonacci(n: int): - pass + if n < 2: + return n + else: + return fibonacci(n - 1) + fibonacci(n - 2) + +print(fibonacci(5)) +print(fibonacci(6)) +print(fibonacci(7)) +print(fibonacci(8))