A function catches errors with three except clauses.
def check(v):
try:
return 10 // v
except ArithmeticError:
return "A"
except ZeroDivisionError:
return "Z"
except Exception:
return "E"
print(check(0), check("2"), check(5))
What does the program print?
Log in to join the discussion.
Loading…