This commit is contained in:
2023-04-20 06:17:41 +02:00
parent 3871bb8d99
commit 601b5de46d
14 changed files with 783 additions and 0 deletions

15
teil13/fib.py Normal file
View File

@@ -0,0 +1,15 @@
# fib.py
import sys
# berechnet rekursiv die Fibonaccizahl n.
def fib(n):
# Rekursionsbedingung
if n in [0,1]:
return 1
else:
# Rekursionsaufruf
return fib(n-1) + fib(n-2)
element = int(sys.argv[1])
print(fib(element))