From 1b3124e4a5fde9e7a70d10c623919c5c79770bfd Mon Sep 17 00:00:00 2001 From: studentpiyush Date: Thu, 2 Oct 2025 09:09:05 +0530 Subject: [PATCH] Add edge-case doctests to fibonacci.py (#9943) --- maths/fibonacci.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maths/fibonacci.py b/maths/fibonacci.py index 24b2d7ae449e..135ab7cbf063 100644 --- a/maths/fibonacci.py +++ b/maths/fibonacci.py @@ -40,10 +40,13 @@ def time_func(func, *args, **kwargs): def fib_iterative_yield(n: int) -> Iterator[int]: """ Calculates the first n (1-indexed) Fibonacci numbers using iteration with yield + >>> list(fib_iterative_yield(0)) [0] >>> tuple(fib_iterative_yield(1)) (0, 1) + >>> tuple(fib_iterative_yield(2)) + (0, 1, 1) >>> tuple(fib_iterative_yield(5)) (0, 1, 1, 2, 3, 5) >>> tuple(fib_iterative_yield(10))