Back to blog
PythonWeb Dev

Debugging Like a Pro (Even When You Are 10)

Errors are not failures, they are clues. Here is the routine real developers use to squash bugs.

Adam 28 July 2026 4 min read
Debugging Like a Pro (Even When You Are 10)

Every professional programmer writes broken code every single day. The difference is that they have a routine for fixing it.

The four-step routine

  • Read the error message out loud. It usually names the line.
  • Print the values around that line to see what the computer sees.
  • Change one thing at a time, then run it again.
  • Explain the problem to a pet, a plant or a rubber duck.

Printing your way out of trouble

python
 1total = 0
 2prices = [3, 5, "7"]
 3
 4for price in prices:
 5    print("adding", price, type(price))  # the clue is here
 6    total += int(price)
 7
 8print("Total:", total)

Try it yourself

Break your own code on purpose and fix it.

  1. 1Take a working program and delete one colon.
  2. 2Read the error carefully and write down what it says.
  3. 3Fix it, then remove a quotation mark and repeat.
  4. 4Keep a bug diary: every bug you name you will recognise next time.
Back to blog

Keep going