fibbonaci

This commit is contained in:
Christoph J. Scherr 2023-09-04 20:43:25 +02:00
parent 2297220759
commit 3106a55d8e
1 changed files with 6 additions and 0 deletions

6
src/fib.py Normal file
View File

@ -0,0 +1,6 @@
def fib(n):
fibs = [0, 1]
for i in range(2, n+1):
fibs.append(fibs[i-1] + fibs[i-2])
print(fibs)
return fibs[n]