How to use these challenges
Work through each level in order. Write the program, then test it with normal, boundary and erroneous data. Only open a hint after a real attempt. These match the kind of programming skills GCSE papers test.
Level 1: warm up
- Even or odd: ask for a number and say whether it is even or odd. Hint: use % 2.
- Biggest of three: ask for three numbers and output the largest. Hint: if and elif, or max().
- Countdown: count down from any number to 1, then print “Lift off”. Hint: range(n, 0, -1).
- Times table tester: ask ten random questions and give a score. Hint: random.randint.
- Temperature converter: Celsius to Fahrenheit. Hint: F = C × 9 / 5 + 32.
Level 2: strings and lists
- Vowel counter: count the vowels in a sentence. Hint: loop through each character and check “in "aeiou"”.
- Palindrome checker: is a word the same backwards? Hint: word[::-1].
- List average: enter ten scores into a list and output the average, highest and lowest. Hint: sum(), len(), max(), min().
- Username generator: first three letters of the surname plus year of birth. Hint: string slicing.
- Validation loop: keep asking for an age until it is between 11 and 18. Hint: a while loop.
Level 3: exam style
- Linear search: search a list for a name without using “in”. Output its position or “Not found”.
- Bubble sort: sort a list of numbers without using sort(). See the cheat sheet.
- Login system: three attempts to enter the correct username and password.
- Two-dimensional list: store three students' scores on three tests and output each student's total.
- File reader: read names from a text file and write them, sorted, into a new file.
Test like an examiner
| Test data | Example for an age between 11 and 18 |
|---|---|
| Normal | 14 |
| Boundary | 11 and 18 (accepted), 10 and 19 (rejected) |
| Erroneous | “fourteen”, -5 |

