/en-tutor-prep-s2-ict-programming-basics-python-variables-loops-practice-2/
/en-tutor-prep-s2-ict-programming-basics-python-variables-loops-practice-2/
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

Paper 2: Loops and operators

Paper 2: Loops and operators

  • 2026-11-21

Paper 2: Loops and operators

Chapter practice with ten items, answers and a one-line note for each, about 25 minutes.

Paper 2 Ten items on this chapter with answers for immediate marking.

01 Paper details (check answers afterwards)

Item Detail
Questions 10
Suggested time 25
Difficulty mix Foundation 4 · Intermediate 2 · Challenge 2 · Error redo 2
Chapter Chapter: Programming basics: variables and loops
Level Advanced

02 Questions (10 items)

  1. Foundationtotal starts at 0, then for i in range(1, 6): total += i runs. What is total?
  2. Foundationcount starts at 0 and count += 1 runs inside while count < 3. What is count at the end?
  3. Foundations starts at 0, then for i in range(2, 11, 2): s += i runs. What is s?
  4. FoundationWhat are 3 ** 2 and 2 ** 3?
  5. IntermediateWhat is the result of len(“programming”)?
  6. IntermediateWhere should an accumulator be set to 0 before summing inside a loop?
  7. ChallengeHow many times does for i in range(10, 0, -3) run?
  8. ChallengeThe text s is “abc”. What is s[1]?
  9. Error redoWhat is the result of int(3.9)?
  10. Error redoWhat is wrong with the line if x = 5:?

03 Answers and one-line notes

# Answer One-line note
1 15 Adding 1 to 5 gives 15.
2 3 The condition allows 3 additions before it turns false.
3 30 A step of 2 adds 2, 4, 6, 8 and 10, giving 30.
4 9 and 8 The double star means power, not multiplication.
5 11 len counts characters, of which there are 11.
6 Before the loop starts Resetting it inside the loop wipes out earlier running totals.
7 4 times i takes 10, 7, 4 and 1 before falling out of range.
8 The text b Indexing starts at 0, so the second character is b.
9 3 int drops the decimal part instead of rounding.
10 A single equals sign assigns; comparison needs two The condition should be written as if x == 5:.

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 the whole chapter? See all four difficulty papers on the chapter page.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 →