/en-tutor-prep-s2-ict-programming-basics-python-variables-loops-practice-1/
/en-tutor-prep-s2-ict-programming-basics-python-variables-loops-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: Variables and range basics

Paper 1: Variables and range basics

  • 2026-11-21

Paper 1: Variables and range basics

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: Programming basics: variables and loops
Level Basic

02 Questions (10 items)

  1. FoundationA program sets x = 5 then runs x = x + 3. What is x afterwards?
  2. FoundationWhat does print(“3” + “4”) output?
  3. FoundationWhich is a valid Python variable name: total_2, 2total or total-2?
  4. FoundationHow many times does the body of for i in range(5) run?
  5. IntermediateWhich values does i take in for i in range(1, 4)?
  6. IntermediateLoop bodies must be indented. What does the indentation decide?
  7. ChallengeWhat is the result of int(“12”) + 3?
  8. ChallengeWhat are 7 // 2 and 7 % 2?
  9. Error redoThe while condition is False from the start. How often does the body run?
  10. Error redoWhat happens if the text “12” is added straight to the integer 3?

03 Answers and one-line notes

# Answer One-line note
1 8 The right-hand side is evaluated first, so 5 plus 3 gives 8.
2 The text 34 Two strings joined by a plus sign are concatenated, not added.
3 total_2 A name may not start with a digit and may not contain a minus sign.
4 5 times range(5) yields 0 to 4, which is 5 values.
5 1, 2 and 3 The stop value 4 is excluded, so there are 3 passes.
6 Which statements belong to the loop Only statements at the same indent level are repeated.
7 15 int converts the text to a whole number before the addition.
8 3 and 1 Floor division gives the quotient 3 and the modulo gives remainder 1.
9 Zero times A false condition skips the body entirely.
10 A TypeError is raised Text and integers cannot be added; convert with int first.

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 →