Paper 3: Exceptions in depth
Chapter practice with ten items, answers and a one-line note for each, about 25 minutes.
| 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 | Challenge |
| # | Answer | One-line note |
|---|---|---|
| 1 | 93 lines. | 100 minus 7 gives 93; the rest are written normally. |
| 2 | 93.0 percent. | 93 out of 100 times 100 gives 93.0. |
| 3 | 100000 bytes. | 2500 times 40 gives 100000 bytes. |
| 4 | 97.66 KiB. | 100000 divided by 1024 gives 97.66 KiB. |
| 5 | 0.5 percent. | 5 out of 1000 times 100 gives 0.5. |
| 6 | 60 handles. | 12 times 5 gives 60; exhausting handles makes later opens fail. |
| 7 | The more specific subclass first. | Branches match top to bottom, so list subclasses before their parents. |
| 8 | raise. | raise takes an exception class or instance to stop on invalid data. |
| 9 | Use str(e). | as e binds the exception object; str(e) gives a readable message. |
| 10 | f.close(). | finally guarantees the block runs, but the close call must be written. |
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.

