/en-tutor-prep-s4-ict-python-programming-practice-4/
/en-tutor-prep-s4-ict-python-programming-practice-4/
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

S4 ICT: Python Programming Basics (Paper 4 (error clinic))

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.

Direct answers Level: S4 ICT; format: variables and types, integer division, conditionals, loops, lists and functions.

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)

  1. FoundationWith lst = [10, 20, 30], what does print(lst[1]) output?
  2. FoundationWhat does print(len([1, 2, 3, 4])) output?
  3. FoundationWith def add(a, b): return a + b, what does print(add(2, 3)) output?
  4. IntermediateWith lst = [10, 20, 30], after lst.append(40), what do print(lst[-1]) and print(len(lst)) output?
  5. IntermediateWith def f(a): a = a + 1 and no return statement, what does print(f(3)) output?
  6. IntermediateWhat does print(“PYTHON”[1:4]) output?
  7. ChallengeWith scores = [88, 92, 79, 95], what is the mean using sum and len?
  8. ChallengeFor the same list, what is the maximum found by max() and what is its index?
  9. ChallengeWhat does print(“banana”.count(“a”)) output?
  10. 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.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →