December 2021
Beginner
840 pages
47h 29m
English
When an error occurs in a syntactically valid Python program, that error is referred to as an exception. Exceptions are immediately fatal when they are unhandled. Exceptions may be raised and caught as a way to affect the control flow of a Python program. Consider the following interaction with Python:
In executing the syntactically valid second line of code, the interpreter raises a NameError because integer is not defined before the value of integer is used. Because this exception is not handled by programmer, it is fatal. However, the exception may be caught and handled:
This example ...
Read now
Unlock full access