We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Raising Exceptions Review

As you've noticed, there are many types of exceptions. Many specific exceptions are built into the language like IndexError and ZeroDivisionError, and (almost) all Exceptions count as the parent Exception type. except matches exceptions by type, not by the message string passed to Exception(...). It catches the named type and more specific types, but not more general ones.

If you're interested in the official documentation on all the built-in exceptions you can find a list here.

Refer to the Following Code for the Question

try:
    raise Exception("zero division")
except ZeroDivisionError as e:
    print("zero")