S5 ICT Programming Loops, Paper 4: squares, odd sums and debugging
Paper 4 works through squares to 25, an odd sum of 25, six characters from repeated letters, six nested iterations that grow with the outer loop, seven doublings to 128, the largest digit of 5071, an even sum of 110, nine products from a 3 by 3 nest, a final square of 100 and a range upper-bound slip.
| Item | Detail |
|---|---|
| Questions | 10 |
| Suggested time | 25 |
| Difficulty mix | Foundation 4 · Intermediate 3 · Challenge 2 · Error redo 1 |
| Chapter | Chapter: S5 ICT: Programming Loops in Python |
| Level | S5 |
| # | Answer | One-line note |
|---|---|---|
| 1 | 25 | Squaring 1 to 5 gives 25 as the last value, since 5 times 5 is 25. |
| 2 | 25 | Only the odd numbers 1, 3, 5, 7 and 9 are added, giving 25. |
| 3 | 6 characters | Each letter is printed twice, so aabbcc holds six characters. |
| 4 | 6 | The inner loop runs 0, 1, 2 and 3 times, which adds up to 6. |
| 5 | 7 rounds, final i is 128 | Doubling from 1 gives 2, 4, 8, 16, 32, 64 and 128, so the seventh round ends with 128 above 64. |
| 6 | 7 | The four digits are 5, 0, 7 and 1, and the largest is 7. |
| 7 | 110 | The even numbers from 2 to 20 are ten values averaging 11, so the total is 110. |
| 8 | 9 numbers | Three outer rounds times three inner rounds give nine numbers, and the last one is 9. |
| 9 | 100 | The list collects the squares of 1 to 10, so the last element is 10 squared, which is 100. |
| 10 | 15, using range(1, 6) | The upper bound of range is excluded, so range(1, 5) stops at 4; range(1, 6) is needed to include 5. |
Book an S5 ICT tutorTutor 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.

