Skip to content

Commit c25c1f0

Browse files
committed
fibonaci
1 parent 2fa555b commit c25c1f0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

maths/fibonacci.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import functools
2020
from math import sqrt
2121
from time import time
22-
from collections.abc import Generator
22+
from collections.abc import Iterator
2323

2424

2525
def time_func(func, *args, **kwargs):
@@ -61,10 +61,9 @@ def fib_iterative(n: int) -> list[int]:
6161
fib.append(fib[-1] + fib[-2])
6262
return fib
6363

64-
def fib_iterative_yield(n: int) -> Generator[int]:
64+
def fib_iterative_yield(n: int) -> Iterator[int]:
6565
"""
66-
Calculates the first n (1-indexed) Fibonacci numbers using iteration with yield method to save memory
67-
>>> f = fib_iterative_yield(3)
66+
Calculates the first n (1-indexed) Fibonacci numbers using iteration with yield
6867
>>> next(f)
6968
1
7069
>>> next(f)

0 commit comments

Comments
 (0)