The Errors That You Will Encounter - Python Bootcamp: The Crash Course for Understanding the Basics of Python Computer Language (2016)

Python Bootcamp: The Crash Course for Understanding the Basics of Python Computer Language (2016)

Chapter 6. The Errors That You Will Encounter

Python users encounter three kinds of errors: exceptions, logic errors, and syntax errors.

Exceptions

These errors occur when the Python interpreter cannot perform an action, though it knows what should be done. A good example would be running a Google search while you are offline: the machine knows what to do but it cannot accomplish it.

Logic Errors

Logic errors are extremely hard to find. Also, they are the most common errors that you’ll get. Python programs that are affected by logic errors can still run. However, they may crash or produce unexpected results.

You can use a debugger to find and solve logic errors in your programs.

Syntax Errors

This is perhaps the most basic kind of error. A syntax error occurs when the Python interpreter cannot understand a code. According to programmers, syntax errors are fatal most of the time– you cannot execute codes that contain this error.

Syntax errors are often caused by typos, wrong arguments, or wrong indentation. That means you should inspect your codes for these mistakes whenever you encounter a syntax error.