/en-tutor-prep-s5-ict-programming-python-loops-practice-4/
/en-tutor-prep-s5-ict-programming-python-loops-practice-4/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

S5 ICT: Python Loops, error rework

S5 ICT: Python Loops, error rework

  • 2026-11-20

S5 ICT: Python Loops, error rework

Paper four corrects the ten commonest misconceptions: range boundaries, an unupdated while condition, missing indentation, what break and continue do, rewriting the loop variable and an uninitialised accumulator.

Error rework: ten loop misconceptions to fix This paper corrects ten common misconceptions one at a time: that range(1, 5) has five values when it has four, that a while condition is written once and never updated, that the body may stay unindented, that range(5) starts at 1 instead of 0, that an inner break exits both layers, that continue stops the loop, that rewriting the loop variable skips rounds, that an accumulator may be added to before being set to zero, that range(2, 12, 3) holds three values when it holds four, and that a print after the loop repeats.

01 Paper details (check answers afterwards)

Item Detail
Questions 10
Suggested time 25
Difficulty mix Foundation 3 · Intermediate 3 · Challenge 3 · Error redo 1
Chapter Chapter: S5 ICT: Python Loops (for and while)
Level Error rework (10 items)

02 Questions (10 items)

  1. FoundationMisconception: range(1, 5) gives five values. How many does it really give?
  2. FoundationMisconception: a while condition needs writing only once. What is the correct practice?
  3. FoundationMisconception: the body of a for loop may stay unindented. What is correct?
  4. IntermediateMisconception: range(5) starts at 1. What is the real starting value?
  5. IntermediateMisconception: break in the inner loop exits both layers. What really happens?
  6. IntermediateMisconception: continue ends the whole loop. What does it do?
  7. ChallengeMisconception: rewriting the loop variable inside a for loop skips rounds. What happens?
  8. ChallengeMisconception: an accumulator may be used before it is set to zero. What error appears?
  9. ChallengeMisconception: range(2, 12, 3) has only three values. How many are there?
  10. Error redoMisconception: a print after the loop repeats many times. How many times does it run?

03 Answers and one-line notes

# Answer One-line note
1 Four. The stop value is excluded, so only 1, 2, 3 and 4 appear.
2 Update the variable the condition depends on inside the body. A condition that never changes produces an infinite loop.
3 The body must be indented, usually by four spaces. Without indentation Python raises a syntax error and nothing runs.
4 0. The default start is 0 and the stop value is excluded.
5 Only the innermost loop ends and the outer loop continues. Leaving several layers needs a flag or a function return.
6 It skips the rest of that round and moves to the next. continue never terminates the loop.
7 The next value comes from the sequence, so the rewrite is ignored. Use continue or change the sequence itself to skip rounds.
8 A name error, because the variable is undefined. Initialise first, or the very first addition fails.
9 Four. The values are 2, 5, 8 and 11, one more than a rough guess.
10 Once. A statement outside the loop runs a single time.

04 What to do after marking

  • After marking, redo only the wrong items and write down which step went wrong (formula, unit, or misread number).
  • Repeat the same item two days later; move to the next paper only when both attempts are correct.
  • Parents only need the answer and note columns; there is no need to explain every item.

Want every loop traced line by line? Book a TutorZone tutor and walk through all ten items in 25 minutes.Tutor Registration →

Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →