Did you know? A loop trace records what the program actually does, not what its author probably intended. G3 Computing tuition can help your child follow each assignment in order, update the current variable values and recheck the loop condition. Start with a small trace table before running the code.
For an original example, set total = 0 and n = 1. While n ≤ 3, add n to total, then increase n by 1. The totals become 1, 3 and 6; n finishes at 4, and the loop stops. Missing the final update often produces a convincing but incorrect trace.
The 2027 SEC G3 Computing syllabus is K349. It includes Python iteration and manual dry runs using trace tables. For Punggol parents choosing Computing support, ask the tutor to inspect the student’s intermediate steps as well as the final output.
Find your next learning step
Match the skill to K349 Computing · Find where the trace first diverges · Trace the loop one executed instruction at a time · Change the order and predict the effect · Look for accurate tracing without prompts
Match the skill to K349 Computing
The official syllabus includes interpreting program constructs, implementing for and while loops, producing trace tables and using print statements to inspect values. Tracing therefore connects understanding code with testing it.
The example below is original unassessed practice. It uses a short while loop so the student can inspect every update. It is not a specimen question or an official model answer.
Read the official 2027 K349 Computing syllabus alongside the school’s current guidance.
Find where the trace first diverges
Ask the student to label the starting values and point to the next instruction. After each assignment, ask which variable changed and which stayed the same.
If the first row is already wrong, check initialisation. If the first pass is right but later passes fail, check whether the student reused an old value. If there is an extra pass, check the condition and the order of updates.
Stop at the first mismatch rather than correcting only the final total. That is the point where the tutor can see the student’s misunderstanding.
Trace the loop one executed instruction at a time
Use this original Python code:
total = 0
n = 1
while n <= 3:
total = total + n
n = n + 1
print(total)
Initially, total is 0 and n is 1. The condition is true. Adding n produces total = 1, and increasing n produces n = 2. On the next pass, total becomes 3 and n becomes 3. On the third pass, total becomes 6 and n becomes 4.
The next condition check is false because 4 ≤ 3 is false. The program prints 6. A full explanation distinguishes the last value added, which is 3, from n’s final value, which is 4.
The summary table records end-of-pass values. For a task requiring every assignment, expand it to include a row after each executed statement and follow the supplied trace-table format.
| Point in execution | n | total | Next condition check |
|---|---|---|---|
| Initial values | 1 | 0 | 1 ≤ 3: true |
| After first pass | 2 | 1 | 2 ≤ 3: true |
| After second pass | 3 | 3 | 3 ≤ 3: true |
| After third pass | 4 | 6 | 4 ≤ 3: false |
Change the order and predict the effect
Move n = n + 1 before total = total + n while keeping the initial values and condition. The values added are now 2, 3 and 4, so the output becomes 9. The condition is tested before entering the loop body; changing n inside that body does not undo the current pass.
Next change ≤ to < in the original code. Only 1 and 2 are added, so the output is 3. These tiny changes show why reading the exact condition and execution order matters.
Ask the student to predict first, trace second and run third. Running the program is useful for verification, but copying its output does not demonstrate a manual dry run.
Look for accurate tracing without prompts
Give a fresh loop with a different starting value, increment or stopping condition. Ask for current values after each assignment and a clear reason for termination.
If an update is removed from a while loop, ask whether the condition can ever become false. Discuss the logic on paper before running an example that may not terminate.
Bring the code, trace and expected result to a consultation. Ask whether support will address assignment, conditions, nesting or debugging, and how progress will be checked on unfamiliar programs.
Choose a focused next step
Then use the G3 test-data guide to check a program against its requirements.
See the related G3 Computing test-data guide and the Primary, PSLE and SEC subject directory.
For parents in Punggol, bring the actual subject level, examination year, recent work and teacher feedback. Ask what the proposed support will address and how independent progress will be checked. Confirm the provider’s subject availability before booking.
The Clementi Secondary 1 Mathematics guide shows how diagnosis and focused 3-pax support can make a student’s reasoning visible. Use that teaching principle when assessing support for your child’s actual subject.
Official syllabus checked 11 October 2026. The examples in this guide are original teaching activities, not SEAB questions or official model answers.

