/en-tutor-prep-s3-ict-python-loops-functions-practice-1/
/en-tutor-prep-s3-ict-python-loops-functions-practice-1/
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 1: Basics: range, accumulators and simple functions

Paper 1: Basics: range, accumulators and simple functions

  • 2026-11-21

Paper 1: Basics: range, accumulators and simple functions

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

Paper 1 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: S3 ICT: Python loops and functions
Level Basic

02 Questions (10 items)

  1. FoundationHow many times does `for i in range(5):` run?
  2. FoundationAfter `total = 0` and `for i in range(1, 6): total += i`, what is total?
  3. FoundationWhat is the last number produced by `range(2, 11, 2)`?
  4. FoundationUse a for loop to add every integer from 1 to 100. What is the total?
  5. IntermediateWith `n = 3`, a `while n > 0:` loop prints n then does `n -= 1`. How many lines print?
  6. IntermediateGiven `def double(x): return x * 2`, what does `double(7)` give?
  7. ChallengeGiven `def add(a, b): return a + b`, what does `add(3, 4)` give?
  8. ChallengeAdd the even numbers from 1 to 10 with a for loop. What is the total?
  9. Error redoGiven `def square(n): return n * n`, what does `square(9)` give?
  10. Error redoWhat is the most common fatal mistake in a while loop?

03 Answers and one-line notes

# Answer One-line note
1 Five times (i takes 0, 1, 2, 3 and 4). range(5) starts at 0 and holds five values, so the body runs five times.
2 15. The loop adds 1, 2, 3, 4 and 5 in turn.
3 10. It starts at 2 and steps by 2: 2, 4, 6, 8, 10, and 12 is already past the stop value.
4 5050. The pairing formula gives 100 x 101 / 2, and the loop total matches it.
5 Three lines (3, 2, 1). n drops by one each round and the loop stops once n reaches 0.
6 14. The parameter x receives 7 and the function returns 7 x 2.
7 7. The two arguments go in by position, so 3 + 4 = 7.
8 30. 2+4+6+8+10 = 30, and a guard of `i % 2 == 0` picks the even values.
9 81. 9 x 9 = 81.
10 Never changing the variable the condition depends on, which gives an endless loop. If the condition is n > 0 but n never changes, it stays true for ever and the program never stops.

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 →