3 zero bad. It stops with TypeError on the third call instead.
def safe_div(a, b):
try:
return a // b
except ZeroDivisionError:
return "zero"
print(safe_div(9, 3), safe_div(1, 0), safe_div("6", 2))
Which change makes the program print exactly 3 zero bad?Log in to join the discussion.
Loading…