This commit is contained in:
adii1823
2021-10-28 17:39:13 +05:30
parent b6eb3ef8a7
commit 32c12d89f4
11 changed files with 301 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
# exceptions/multiple.py
values = (1, 2) # try (1, 0) and ('one', 2)
try:
q, r = divmod(*values)
except (ZeroDivisionError, TypeError) as e:
print(type(e), e)
try:
q, r = divmod(*values)
except ZeroDivisionError:
print("You tried to divide by zero!")
except TypeError as e:
print(e)