Debugging with Python - Part 1
Debugging with Python Part 1 Errors Debugging is the process of identifying and fixing bugs (i.e. errors in the code which lead to incorrect software functionality). So, before we discuss “ fixing bugs ”, let’s explore the types of errors we might make in our programs. We will be looking at the three basic types of errors; namely compilation errors, runtime errors and logical errors. 1. Compilation Errors Compilation errors occur during the compilation phase and prevent the program from running. These are generally syntax errors (i.e. violations of the syntactic rules of the programming language). However, Python is an interpreted language, and the Python interpreter checks for syntax errors as it reads and parses the script. It won’t run the script and will output an error message indicating the type of compilation error and the line of code so that we can easily rectify our mistake. Let’s look at two of the most familiar compilation errors we might encount...