...

/

User-defined Exceptions

User-defined Exceptions

Learn how to apply user-defined exceptions in Python.

We'll cover the following...

Defining our exception class

Since not all exceptional conditions can be anticipated, there cannot be a class in the Python library for every exceptional condition.

In such cases, we can define our own exception class, as shown in ...