What if the steps are in the wrong order?
By the end of this lesson
Put steps in a working order and use a simple debug habit (what did I expect? what happened? which line?).
Remember
- Sequence = order. Socks then shoes. Open the file then type. Boil water then add noodles.
- A bug is a mistake in the instructions (or their order).
- Wrong order is still a bug even if every single step looks sensible alone.
- Debug: expected vs happened, then find the first wrong line.
- Print / show in-between values. Do not rewrite everything in panic.
Worked examples
Cover the answer. Try the steps on paper, then open them.
Example 1 — Shoes bug
Steps: tie laces; put on shoes; pick up shoes.
- You cannot tie laces before the shoes are on
- Fix: pick up → put on → tie
Answer: order repaired
Check: Each step was fine; the sequence was not.
Example 2 — Code-shaped
print(score) then score = 5. What prints?
- score does not hold 5 yet
- You will get an error or an old value
- Fix: set score first, then print
Answer: assign before use
Check: Same as algebra: name the box before you open it.
Example 3 — Debug card
Program should show 8 but shows 5.
- Expected: 8. Happened: 5.
- Which line computed the number?
- Check that line’s inputs
- Fix one thing, run again
Answer: expected / happened / which line
Check: Scientists debug this way too.
Common mistakes
Slip Deleting the whole program when one line is wrong.
Fix Find the first failing step.
Smallest change that could fix it.
Slip Thinking a bug means you are “bad at computers”.
Fix Every programmer debugs daily.
It is the job, not a shame.
Slip Changing three things at once, so you cannot tell what worked.
Fix One change, then test.
Otherwise you learn nothing.
Try on paper first
Write the answer, then tap Reveal. These are not the quiz — they are warm-ups.
1. Sequence means…
Answer: The order of steps
2. A mistake in instructions is a…
Answer: Bug
3. Name the three debug questions.
Answer: Expected? Happened? Which line?
4. Put in order: eat noodles; boil water; add noodles.
Answer: boil → add → eat
Touch practice
8 tap / typeTap or type. Use the hint if you need it. Retry any miss — the why is the lesson.
Optional picture lab
After practiceReal world
Socks after shoes — oops.
Connect
Debugging is a superpower.
⭐ Star quiz
9 questionsDo the worked examples and touch practice first. Then take the quiz without peeking.