Skip to content
Happy Programming Guide
Start learning
Debugging & Errors

Reading errors and stack traces (for beginners)

Error messages are instructions, not insults. Read the bottom line first, then the line above it, and most errors stop being frightening.

A macro photograph of a bright red ladybug with black spots on a small sprout of green leaves growing out of

Most beginner bugs aren’t mysterious — they’re just unread error messages. Spending two minutes on the trace beats two hours of guessing.

A typical Python traceback#

  1. Bottom line — what happened: ZeroDivisionError: division by zero.
  2. Above — the call chain. app.py:6 is where the divide happened.
  3. Top — where execution started: app.py:12 called average.

Three habits that pay off#

Where to go next#

Full guideHow to read programming errors

Keep reading

Keep going — pick your next guide

The fastest way to improve is to read one guide, then build the thing it describes. Start with the basics, or jump straight to a project.