S3 ICT: Python Programming Basics (Paper 4 (error clinic))
- 2026-11-14
Tutor Prep Guide · Variables and assignment, arithmetic with integer division and remainder, converting input strings, range boundaries, for and while loops, conditionals, dry runs and common errors
S3 ICT: Python Programming Basics (Paper 4 (error clinic))
Paper 4 (error clinic): ten questions on Python programming basics, with answers and notes.
Direct answers Level: S3 ICT; format: variables, arithmetic, type conversion, range boundaries, loops and conditionals.
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: S3 ICT: Python Programming Basics |
| Level | S3 |
02 Questions (10 items)
- FoundationThe line print(“5” + 3) raises a TypeError. How should it be fixed?
- FoundationWhat error does print(10 // 0) raise?
- FoundationIf the line under an if statement is not indented, which error appears?
- IntermediateA line reads if score > 50 with the colon missing. What happens?
- Intermediateint(“3.7”) raises a ValueError. What is the correct approach?
- IntermediateError clinic: after input reads “7”, print(input_value + 5) fails. How should it be changed?
- ChallengeA student thinks range(5) counts from 1 to 5. Which numbers does it actually produce?
- ChallengeA program uses a variable total that was never assigned. Which error is raised?
- ChallengeIn while i < 3: print(i) the line i = i + 1 is missing. What happens?
- Error redoError clinic: a student expects print(3, 4) to output 7. What does it actually print?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | write print(“5” + str(3)) | A string can only be added to a string, so the number must be converted, giving 53. |
| 2 | ZeroDivisionError | Dividing by zero always raises ZeroDivisionError and stops the program. |
| 3 | IndentationError | Python uses indentation to mark blocks, so a missing indent raises IndentationError. |
| 4 | SyntaxError | The if line must end with a colon, and without it a SyntaxError is raised before the program runs. |
| 5 | convert with float first | int rejects a string with a decimal point, so int(float(“3.7”)) is needed and gives 3. |
| 6 | use int(input_value) + 5 | input returns a string, so it must become an integer before adding 5, giving 12. |
| 7 | 0 to 4 | A single-argument range starts at 0 and stops before 5, giving 0, 1, 2, 3 and 4. |
| 8 | NameError | Using a name before it is defined raises NameError, so initialising total = 0 first fixes it. |
| 9 | an endless loop | i never changes, so the condition stays true and the loop never ends until the step is added. |
| 10 | 3 4 | A comma inside print only separates the items with a space, so print(3 + 4) is needed for addition. |
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.
Write down the value of every variable line by line before stating the output. Remember input returns a string, so convert it with int before adding.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.



