ABSTRACT

In this chapter, you will encounter dierent types of errors in Python and what you can do to x or avoid them. You will learn how to x three

kinds of errors: syntax errors, runtime errors, and logical errors. Syntax errors are wrong symbols in the program code that Python does not recognize to the point that your program won’t even start. Runtime errors are errors in the code that cause your program to stop abruptly while it is being executed. Logical errors mean that your program nishes normally, but the results are wrong because the program does something dierent from what you had in mind. You will learn strategies that help you write programs that contain fewer errors and where errors are easier to nd. When you get stuck despite these eorts, it is time to ask for help (see Box 12.1).