how to handle Exceptions (Errors)ΒΆ

When an error happens in Python, an Exception is raised to stop the program, this means nothing past the line that caused the error runs.

It is useful because there is a problem that must be solved for the program to continue, and it is a problem when it causes the program to stop early.

What if I want the program to run even with errors? I might want to give messages to the user who does not care about or understand the details of the error.

Exception Handling is a way to deal with this, it allows programs to do something different when an error happens.

These tests show how to handle Errors(Exceptions) in tests and in programs




Click Here to see the code from this chapter