Standard difficulty · 20 questions · 40 marks · Time: 37 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Strings · AW-11CS-STR-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) immutable: their characters cannot be changed in place | — |
| 2 | (d) anana | start is included, stop is not; a negative index counts from the end |
| 3 | (d) LAMP DATA | upper() changes every letter to a capital |
| 4 | (d) 2 | indexes start at 0; the first 'l' is at 2 |
| 5 | (c) False | isalnum() checks every character of 'lamp loop' |
| 6 | (b) b, o, o, k | join() puts the separator between the characters |
| 7 | (b) 2 | the vowels in 'cricket' |
| 8 | (a) it stops with a TypeError, because a string cannot be changed in place | strings are immutable |
| 9 | A string cannot be changed in place: s[0] = 'X' is a TypeError; a new string must be made, e.g. s = 'X' + s[1:]. | — |
| 10 | (a) sci; (b) ecneics | index: s0 c1 i2 e3 n4 c5 e6 |
| 11 | (a) 1; (b) 5 | count() counts; find() gives the first index |
| 12 | (a) 6; (b) False; (c) False | len() counts characters; in checks for the text; startswith() checks the beginning |
| 13 | (a) ['text', 'byte', 'note', 'word']; (b) word | split(';') cuts at every ';' |
| 14 | (a) 1; (b) 22; (c) 1 | spaces are none of the three |
| 15 | (a) char::file::char; (b) file file file | join() puts the separator between the parts; replace() changes every occurrence |
| 16 | Not a palindrome | s[::-1] is 'margorp' |
| 17 | 'ab' + 'cd' = 'abcd'; 'ab' * 2 = 'abab'; 'b' in 'abc' is True; 'python'[1:4] = 'yth'. | — |
| 18 | (a) 17; (b) flo; (c) 1; (d) new picture | the space counts as a character |
| 19 | (a) 10; (b) 13; (c) 2; (d) 3 | v: vowels, c: consonants, up: capitals, sp: spaces; digits are not letters |
| 20 | nohtyp egalliv niatnuom | each word reversed, in the same order |