How do I deal with error messages?

Question

I’ve encountered an error message from running my code. How can I resolve this?

Answer

While they may seem intimidating, error messages actually contain very useful information to help you debug your code! For example, it will tell you what line number the error occurred on and what type of exception it is (see here for a list of exceptions). This should help give you an idea of what might’ve gone wrong.

See here for common causes of a NameError.
See here for common causes of an IndentationError and TabError.

1 Like