Oct-05-2019, 02:57 AM
you should add the raise statement after handling the ZeroDivisionError, otherwise you will never see additional exceptions
def division1(divideBy): try: return 72 / divideBy except ZeroDivisionError: print(f'72 divided by 0 produces an Error: Invalid argument.') raise print(f'72 divided by 2 is {division1(2)}.') print(f'72 divided by 12 is {division1(12)}.') print(f'72 divided by 0 is {division1(0)}.') print(f'72 divided by 1 is {division1(1)}.')