Compare commits

...

1 Commits

Author SHA1 Message Date
5c13e24abf Add error-handling.py 2026-10-08 10:14:27 +02:00
2 changed files with 10 additions and 0 deletions

10
error_handling.py Normal file
View File

@@ -0,0 +1,10 @@
def spam(divide_by):
try:
return 42 / divide_by
except ZeroDivisionError:
print('Error: Invalid argument.')
print(spam(2))
print(spam(1))
print(spam(42))
print(spam(0))

View File