Exceptions Lesson

Now that the motivation and some syntax for exceptions has been presented, we can delve a bit deeper into the structure of writing programs containing exceptions. The following lesson is designed to help put into context the rudiments just presented. In addition, one more important component of exception handling is the 'raise' statement which is useful for raising an exception if, for example, it occurs inside an exception handler.


In this chapter, you'll learn all about Exceptions in Python. We'll start by reviewing the exception hierarchy, raising exceptions, examining try and catch, and finally how to create our own Exception classes.

Source: Nina Zakharenko, https://www.learnpython.dev/03-intermediate-python/40-exceptions/
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License.