This commit is contained in:
2023-03-04 10:48:49 +01:00
parent e9a848835d
commit 5512ec868c
9 changed files with 97 additions and 11 deletions

17
teil8/exception.py Normal file
View File

@@ -0,0 +1,17 @@
def func(wert):
if not isinstance(wert,int):
raise TypeError('weertr muss ein int sein.')
if wert >0:
print('Wert ist in Ordnung')
else:
raise ValueError('wert muss größer 0 sein')
func(7)
func(-1)