DSE ICT | Python loops and conditions: a tutor preparation guide (trace tables, three question types, four errors)
- 2026-11-10
Students can write for i in range(5) but guess when asked what i holds after the loop. The gap is not syntax; they have never written execution down. This lesson does one thing: it makes the trace table the first move on every question, so a loop becomes a visible process rather than a memorised line.
01 Prerequisites (3-minute check)
If any of these fails, fix it before the lesson starts.
| Skill | Quick check | Pass mark |
|---|---|---|
| Variables | After x = 3 then x = x + 2, what is x | 5: assignment overwrites, it does not add |
| Operators | What are 10 % 3 and 10 // 3 | 1 and 3: remainder and floor division |
| Indentation | What marks the body of a Python loop | The indent level, not braces |
02 Lesson flow (60 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0-6 min | Three opening questions | Show a three-line loop; ask how many times it runs and what i ends at | Commit an answer, check it later |
| 6-18 min | range in three parts | Change start, stop and step one at a time; students call out counts | Say the count aloud, then code it |
| 18-32 min | Trace table | Model recording i, total and the condition on every line | Fill the same table themselves |
| 32-44 min | while and exit | Rewrite the same job with while; show when the condition turns false | Rewrite and add a zero-iteration test |
| 44-56 min | Three question types | Walk one output, one fill-in and one debugging question | Do one alone and self-mark |
| 56-60 min | Exit check | Collect two questions; mark which boundary or state was lost | Work independently |
03 Teaching script (read it out)
Scene 1: range is a walk between boundaries, not a count of turns
Students do: fill a four-cell row (start, stop, step, count) for three ranges, then run them to confirm.
Scene 2: The trace table: one line at a time, no skipping
Students do: build a six-row table for total = 0 followed by for i in range(1, 6): total = total + i, then state the final total.
Scene 3: while: write the stopping condition before the body
Students do: write the skeleton of a while loop that reads numbers until 0 is entered, and say when the zero-iteration case occurs.
04 Question types and worked steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Output question | State the printed output | Fill the trace table, then copy its printing rows | Number of answers must equal the printing rows |
| Fill in the blank | Complete the range arguments | Work backwards from the count with (b – a + s – 1) // s | Substitute back and check the count |
| Debugging | The loop hangs or gives a wrong result | Find the update, then the indent, then the direction of the test | Name why the single change fixes it |
| State question | Value of a variable after the loop | Run the table to the last row and read that column | The answer must match the table |
05 Independent practice (3 questions)
| Question | Answer | What to watch |
|---|---|---|
| Boundary row | Start, stop, step and count for three ranges | Check whether range(5, 0, -1) is counted as six |
| Trace table | Fill a table for a six-line loop with an if | Check whether the condition column is missing |
| while rewrite | Convert the for version and state the zero case | Check that the update is inside the loop |
06 Common mistakes and what to say
| Mistake | Student writes | Say this |
|---|---|---|
| Treating the stop value as included | Reading range(1, 5) as five turns | “Where does the walk stop? Count it out: 1, 2, 3, 4. Where would a fifth come from?” |
| Skipping rows in the table | Recording total but not i, so the answer drifts | “You did not record i. What was added on the second pass? Add that row back.” |
| No update in while | The loop never ends | “Which line makes this condition false one day? If you cannot find it inside the loop, it is an infinite loop.” |
| Assuming at least one pass | Answering one iteration when the condition is false at the start | “The condition is already false before entry. Which line inside could run? Zero.” |
07 Homework (paper, section and question numbers)
- Secondary ICT chapter index — All chapters for this subject
- Tutor guide master index — Matching chapters in other subjects
- Redo this chapter — Practice items 1, 3 and 5: boundary row plus trace table
08 Exit check (last 5 minutes)
| Question | Answer | Decision |
|---|---|---|
| Three parts of range | Start, stop (exclusive), step | Missing one sends you back to act one |
| Three trace columns | Line, variable values, test result | Cannot name them sends you back to act two |
| while exit | Write the stop condition, then the in-loop update | “It depends” sends you back to act three |
09 Tutor FAQ
Must students memorise the count formula?
No, but they must check with arithmetic; keep it on the board and have them substitute once per question.
Should other languages be taught?
DSE ICT tests concepts, and pseudocode needs the same trace table; one minute on syntax differences is enough.
Which loop comes first for weak students?
for, because the count is known and the boundary is visible; add while only when for is secure.
Find a tutor — freeTutor Registration →
A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.


