/en-tutor-prep-s5-ict-file-handling-exceptions-practice-4/
/en-tutor-prep-s5-ict-file-handling-exceptions-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

Paper 4: Common mistakes corrected

Paper 4: Common mistakes corrected

  • 2026-11-21

Paper 4: Common mistakes corrected

Chapter practice with ten items, answers and a one-line note for each, about 25 minutes.

Paper 4 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: File handling and exceptions
Level Retry

02 Questions (10 items)

  1. FoundationIt is claimed that ‘w’ mode keeps the old content. Is that right?
  2. FoundationIt is claimed that read() returns numbers. Is that right?
  3. FoundationIt is claimed that a bare except catches only the named type. Is that right?
  4. FoundationIt is claimed that the program always stops after an except catches an error. Is that right?
  5. IntermediateIt is claimed that finally runs only on error. Is that right?
  6. IntermediateIt is claimed that leaving files open has no effect. Is that right?
  7. ChallengeIt is claimed that IndexError and KeyError are the same. Is that right?
  8. ChallengeIt is claimed that ‘a’ mode overwrites existing content. Is that right?
  9. Error redoIt is claimed that int(‘12.5’) succeeds and gives 12. Is that right?
  10. Error redoIt is claimed that reading line by line uses more memory than readlines(). Is that right?

03 Answers and one-line notes

# Answer One-line note
1 No. ‘w’ truncates the file; use ‘a’ to keep old data.
2 No. read() returns a string; convert with int() or float() before arithmetic.
3 No. A bare except catches everything, hiding real programming errors.
4 No. Execution continues after the except block; that is the point of handling.
5 No. finally always runs, successful or not, which suits releasing resources.
6 No. Open handles are held and buffered data may never reach the disk.
7 No. IndexError is an out-of-range sequence index; KeyError is a missing dictionary key.
8 No. ‘a’ appends at the end and leaves old content unchanged.
9 No. int() rejects decimal strings; use float(‘12.5’) first or a ValueError follows.
10 No. A line loop holds one line at a time, while readlines() loads the whole file.

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 →