Skip to content

Commit a587f7c

Browse files
author
dodo
committed
flake8
1 parent f6115e8 commit a587f7c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Level_05/fibonacci.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
# siehe dazu https://github.com/pythonfoo/pythonfooLite/wiki/Rekursion_Vs._Iteration.
1212
# Eine wesentlich perfomantere Version findet sich in Level 7.
1313

14+
1415
def fib(n: int) -> int:
1516
# Die ersten beiden Elemente sind fix:
1617
if n <= 1:
1718
return n
1819
# Ansonsten: f(n) = f(n-1) + f(n-2)
19-
return fib(n-1) + fib(n-2)
20+
return fib(n - 1) + fib(n - 2)
21+
2022

2123
n = int(input("Welches Element soll berechnet werden? "))
2224
print(" =>", fib(n))

0 commit comments

Comments
 (0)