This commit is contained in:
2022-11-25 15:47:56 +01:00
parent 0c233cdce8
commit b1238449ad
5 changed files with 51 additions and 0 deletions

14
Freitag/mathematik.py Normal file
View File

@@ -0,0 +1,14 @@
#/usr/bin/env python3
def fak(n):
if n == 0:
return 1
if n < 0:
raise ValueError("Fak ist eine negative Zahl")
if type(n) is not int:
raise TypeError("Fak ist keine ganze Zahl")
return n * fak(n-1)
print(fak(4))