Lazo Lab Sign up

Python Fundamentals / Functions and errors

Lesson 38 of 38

Debugging

Read error messages from the bottom up: the last line says what went wrong, and the lines above say where. Add print() calls to see values, or use a debugger to step through.

Key points

  • The last line of a traceback names the error
  • Check the line number
  • Print variables to see what's really happening
Watch a video on thisOpens YouTube search results for “Debugging” in a new tab

Quiz · +10 XP

Where is the most useful part of a Python traceback?

Log in to save progress and earn XP.