Write Python. Understand every error.

Open the editor

Python error guide

The errors beginners meet most often, what they mean, and how to fix them. In Py-CRAFT's editor, each of these is also explained automatically when it happens in your own code.

SyntaxError

IndentationError

NameError

TypeError

ValueError

IndexError

KeyError

AttributeError

NumPy errors

Other errors

How to use this guide

Each page shows a short program that causes the error, the exact message Python gives, why it happens, and a corrected version that you can open in the editor. Read the message from the bottom: the last line names the kind of error, and the line number above it shows where it happened. Most beginner errors fall into a handful of types, so learning these 44 will help with almost everything you meet.