S4 ICT: Python Programming Basics (Paper 2 (intermediate))
- 2026-11-15
S4 ICT: Python Programming Basics (Paper 2 (intermediate))
Paper 2 (intermediate): ten Python programming questions with answers and one-line notes.
01 Paper details (check answers afterwards)
| Item | Detail |
|---|---|
| Questions | 10 |
| Suggested time | 20 |
| Difficulty mix | Foundation 3 · Intermediate 3 · Challenge 3 · Error redo 1 |
| Chapter | Chapter: S4 ICT: Python Programming Basics |
| Level | S4 |
02 Questions (10 items)
- FoundationWith score = 58 and a program that prints pass when score >= 60 and fail otherwise, what is printed?
- FoundationIn Python, what do one equals sign and two equals signs mean?
- FoundationWhat marks several lines as belonging to the same if block?
- IntermediateWith score = 78 and grades A for 80 or above, B for 70 or above and C otherwise, which grade is printed?
- IntermediateWhich keyword requires both conditions, and which needs only one?
- IntermediateWith n = 7 and a program printing even when n % 2 == 0 and odd otherwise, what is printed?
- ChallengeWith score = 92 and grades A for 90 or above, B for 80 to 89, C for 70 to 79 and fail otherwise, which grade is printed?
- ChallengeA leap year is divisible by four but not by one hundred, or divisible by four hundred. Which of 2024, 1900 and 2000 are leap years?
- ChallengeFor sides 3, 4 and 5, does the test 3 ** 2 + 4 ** 2 == 5 ** 2 hold?
- Error redoWhat happens with if x = 5: and what is the correct form?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | Fail | Fifty-eight is below sixty, so the condition is false and the else branch runs. |
| 2 | One assigns a value and two compare for equality | x = 5 stores five in x, while x == 5 asks whether x equals five. |
| 3 | Indentation | Lines with the same indentation form the block, and inconsistent indentation raises an error. |
| 4 | B | Seventy-eight fails the eighty test but passes the seventy test, so it is graded B. |
| 5 | Use and for both, or for either | and needs both sides true, while or passes as soon as one side is true. |
| 6 | Odd | Seven divided by two leaves remainder one, so the condition is false. |
| 7 | A | Ninety-two meets the ninety threshold, so the first branch holds and later tests are skipped. |
| 8 | 2024 yes, 1900 no, 2000 yes | 2024 is divisible by four and not by one hundred; 1900 is divisible by four and by one hundred but not by four hundred; 2000 is divisible by four hundred. |
| 9 | Yes, it is a right-angled triangle | Nine plus sixteen is twenty-five, exactly the square of five. |
| 10 | A SyntaxError is raised, and if x == 5: is correct | The condition must ask about equality, which needs two equals signs. |
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.
When code fails, read the error message for three things: the line, the error type and the value that was not what you expected. Strings and numbers do not add, input always arrives as a string, so convert the type before calculating; indexes start at 0, so a list of length 3 ends at index 2; indentation is program structure, not decoration. For counting tasks, write the range start, stop and step before calculating.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.
© TutorZone · www.tutorzone.com.hk · For personal study and teaching use only.



