Skip to content

Commit 3601683

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2fa555b commit 3601683

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

maths/fibonacci.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def fib_iterative(n: int) -> list[int]:
6161
fib.append(fib[-1] + fib[-2])
6262
return fib
6363

64+
6465
def fib_iterative_yield(n: int) -> Generator[int]:
6566
"""
6667
Calculates the first n (1-indexed) Fibonacci numbers using iteration with yield method to save memory
@@ -213,14 +214,11 @@ def fib_binet(n: int) -> list[int]:
213214
return [round(phi**i / sqrt_5) for i in range(n + 1)]
214215

215216

216-
217-
218217
if __name__ == "__main__":
219218
num = 30
220219
time_func(fib_iterative, num)
221220
time_func(fib_recursive, num) # Around 3s runtime
222221
time_func(fib_recursive_cached, num) # Around 0ms runtime
223222
time_func(fib_memoization, num)
224223
time_func(fib_binet, num)
225-
time_func(fib_iterative_yield, num)
226-
224+
time_func(fib_iterative_yield, num)

0 commit comments

Comments
 (0)