Standard difficulty · 20 questions · 40 marks · Time: 41 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Python Revision · AW-12CS-PYR-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) tuple | — |
| 2 | (c) EDULE | count indices from 0; the stop index is not included |
| 3 | (a) Data never sleeps at night | capitalize() changes only the first character of the string |
| 4 | (a) [6, 24, 26, 58] | apply each method to the list in turn |
| 5 | (b) 18 22 | T * 3 repeats the tuple, so it has 18 items |
| 6 | (c) 5 | check each character in turn |
| 7 | (c) 320 | assigning to an existing key changes it; a new key is added at the end |
| 8 | (a) True 16 | L * 4 repeats the list 4 times, so it has 16 items |
| 9 | A list is mutable (its items can be changed, added or removed) and is written in [ ]; a tuple is immutable and is written in ( ). | — |
| 10 | NAN | count indices from 0; the stop index is not included |
| 11 | [8, 22] | apply each method to the list in turn |
| 12 | 5 | check each character in turn |
| 13 | (a) 1; (b) 35 | M[i][j] is row i, column j, both counted from 0 |
| 14 | {'l': 1, 'e': 2, 't': 2} | a key is added the first time a letter is seen; get(ch, 0) gives 0 for a new letter |
| 15 | {'apple': 70, 'orange': 55, 'grapes': 25, 'guava': 70} | assigning to an existing key changes it; a new key is added at the end |
| 16 | 98, 85 | sorted largest first: 98, 85, 79, 72, 70, 38, 27 |
| 17 | Characters are numbered from 0 at the left and from −1 at the right. s[i] gives one character; s[a:b] gives the characters from a up to b − 1; s[a:b:k] takes every kth one; s[::−1] reverses. For s = 'PYTHON', s[1:4] is 'YTH', s[−2:] is 'ON'. | indices, slices with start/stop/step, negative indices, examples |
| 18 | (a) Keep calm and write code; (b) MNI; (c) [26, 14, 35, 11] | capitalize() changes only the first character of the string |
| 19 | (a) 5; (b) candle; (c) CKFRL | words: candle, kite, forest, river, ladder; the first longest word is kept because > is strict |
| 20 | (a) 4; (b) Vikram; (c) 386 | marks of at least 73: Vikram, Rahul, Dev, Meera; highest 95 |