July 2021
Intermediate to advanced
392 pages
9h 40m
English
In this chapter, we will cover errors and exceptions and how to find and fix them. Handling exceptions is an important part of writing reliable and usable code. We will introduce basic built-in exceptions and show how to use and treat exceptions. We'll introduce debugging and show you how to use the built-in Python debugger.
In this chapter, we cover the following topics:
The first error that programmers (even experienced ones) are confronted with is when the code has incorrect syntax, meaning that the code instructions are not correctly formatted.
Consider this example of a syntax error:
>>> for i in range(10) File “<stdin>”, line 1 for ...