S4 ICT: Python Programming Basics (Paper 4 (error clinic))
- 2026-11-15
S4 ICT: Python Programming Basics (Paper 4 (error clinic))
Paper 4 (error clinic): 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 lst = [10, 20, 30], what does print(lst[1]) output?
- FoundationWhat does print(len([1, 2, 3, 4])) output?
- FoundationWith def add(a, b): return a + b, what does print(add(2, 3)) output?
- IntermediateWith lst = [10, 20, 30], after lst.append(40), what do print(lst[-1]) and print(len(lst)) output?
- IntermediateWith def f(a): a = a + 1 and no return statement, what does print(f(3)) output?
- IntermediateWhat does print(“PYTHON”[1:4]) output?
- ChallengeWith scores = [88, 92, 79, 95], what is the mean using sum and len?
- ChallengeFor the same list, what is the maximum found by max() and what is its index?
- ChallengeWhat does print(“banana”.count(“a”)) output?
- Error redoWith lst = [10, 20, 30], what happens with print(lst[3]) and why?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | 20 | Indexes start at 0, so index 1 is the second element. |
| 2 | 4 | len() counts the elements and there are four of them. |
| 3 | 5 | The arguments two and three are passed in and return sends back their sum, five. |
| 4 | 40 and 4 | append adds to the end, so index -1 is the last item and the length grows from three to four. |
| 5 | None | A function without return gives back None, so the calculated value never leaves the function. |
| 6 | YTH | A slice includes the start but not the end, so indexes 1 to 3 are taken. |
| 7 | 88.5 | The four scores add to three hundred fifty-four, and dividing by four gives eighty-eight point five. |
| 8 | Maximum 95 at index 3 | Ninety-five is the largest and sits fourth from the start, so its index is 3. |
| 9 | 3 | The string method count returns how often a piece occurs, and the letter a appears three times. |
| 10 | An IndexError is raised | A list of length 3 has a largest index of 2, so index 3 is out of range. |
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.



