The bug detective club

Every bug
leaves a clue.A debugging quiz for kids

Predict the output, spot a little mistake, and discover how programmers think. No timer. No pressure. Just eight chances for an “aha!”

How programmers debug

Four steps to catch a bug

A bug is a mistake that makes a program do something unexpected. Every coder meets bugs, every day. Here’s the detective routine this quiz practices.

1. Read the clue

Look at what the program actually did. An error message’s last line often names the problem and the line where it happened.

2. Predict

Read the code one line at a time, from top to bottom. What should each line do? Where does your prediction stop matching what happened?

3. Change one thing

Fix the smallest suspicious piece first: a missing quote, a wrong number, the wrong order, or an indent in the wrong place.

4. Test again

Run the program again. Try a different input too. If something new goes wrong, that’s just your next clue.

Practice on real code: fix a buggy block program, or open the Python playground and follow the red message.