Paper 4: Common mistakes corrected
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: Programming basics: variables and loops |
| Level | Retry |
| # | Answer | One-line note |
|---|---|---|
| 1 | Text cannot be added to an integer; use str(4) | Convert one side so both types match, with str or int. |
| 2 | It starts at 0 and gives 0 to 4 | range counts from 0, so start from 1 by writing range(1, 6). |
| 3 | The print runs once, after the loop finishes | Indentation decides whether a statement belongs to the loop. |
| 4 | 7 // 2 | A single slash gives 3.5 while a double slash returns the whole quotient. |
| 5 | A syntax error, as a name cannot start with a digit | Use total_2 or total2 instead. |
| 6 | A syntax error, because comparison needs two equals signs | One equals sign assigns a value rather than comparing it. |
| 7 | A NameError on the first pass | The name is read before it exists, so the program stops. |
| 8 | 2 | i keeps its last value, which is 2. |
| 9 | Use float(“12.5”) | int accepts whole-number text only, so text with a decimal point needs float. |
| 10 | IndentationError | Indentation must be consistent or Python cannot tell where a block ends. |
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.

