AQA GCSE Computer Science June 2025 Paper 1, Question 11: the word guessing game
AQA 8525 June 2025 Paper 1, Question 11: trace the findLetter subroutine for the word system, then write the 10 mark program that gives the player eight guesses, updates the hidden word and displays You won or You lost. A model answer and the game to play.
Question 11 is the last question of the AQA GCSE Computer Science Paper 1 sat on 12 May 2025 (8525/1B, the Python paper). Four one mark parts trace a subroutine that you are given. Then comes the biggest program on the paper: 10 marks for a loop that calls that subroutine.
We do not copy the exam paper here. Open it beside this page: AQA June 2025 Paper 1B question paper (PDF). When you have finished, check the mark scheme too.
The subroutine you are given
findLetter(word, letter, hidden) builds a new string, one character at a time. For each position in word: if the character there is the guessed letter, it adds the letter. If not, it adds whatever was at that position in hidden already. It returns the new string.
So hidden starts as asterisks, and each call uncovers every copy of one letter.
Parts 1 to 4: findLetter("system", "s", "y*em")
- 11.1 The value of
letterwhen line 4 first runs: s. It is the second argument, and it never changes. - 11.2 The value of
newHiddenwhen line 6 (theelse) is first reached: the first character of system is s, which matches, so an s has been added. On the second character, y, the test fails and theelseis reached, withnewHiddenholding s. - 11.3 How many times the loop runs: 6, once for each character of system.
- 11.4 The value returned: s, y, s, then
*(the t has not been guessed), e, m: sys*em.
Part 5: the program (10 marks)
You are given code that reads word and builds hidden as the same number of asterisks. Extend it: repeat until the player has had eight guesses or no asterisks are left. Each time, get a letter, call findLetter, update hidden and display it. At the end, display You lost if any asterisks remain, and You won if none do. You must not use built-in routines that search a string or count characters. So no "*" in hidden and no hidden.count("*").
A model answer
guesses = 0
won = False
while guesses < 8 and won == False:
letter = input("Guess a letter: ")
hidden = findLetter(word, letter, hidden)
print(hidden)
guesses = guesses + 1
won = True
for i in range(len(hidden)):
if hidden[i] == "*":
won = False
if won == True:
print("You won")
else:
print("You lost")
The asterisk check is a small loop of your own: assume the player has won, then look at every character, and take the win away if any is still an asterisk.
There is a shortcut that the mark scheme accepts: when no asterisks are left, hidden is the same as word. So if hidden == word does the whole check, with no built-in search.
Where the ten marks are
Two are for design: a loop with the letter input inside it, and selection for the two messages.
Eight are for a program that works: at most 8 guesses; leaving the loop when no asterisks are left, with both conditions joined correctly; calling findLetter inside the loop; the three arguments in the right order; storing what it returns back in hidden; checking for asterisks; displaying hidden after each guess; and You won and You lost in the right places.
Any error caps it at 9.
Where the marks are lost
- Calling
findLetterand ignoring the result.findLetter(word, letter, hidden)on its own changes nothing. It must behidden = findLetter(...). - The arguments in the wrong order. Word, then letter, then hidden, as in the definition.
"*" in hidden. The question forbids it, and it costs two marks.orbetween the loop conditions. The loop carries on while guesses remain and the word is not finished.- Resetting
hiddeninside the loop. Every guess would start again from all asterisks. - Leaving it blank. A
whileloop with aninputinside it, and anif ... elsewith the two messages, are the two design marks, even if nothing else is right.
Run it
The whole game. The word is set in the program so that you can play alone. The robot's light is green if you win.
The program
from bugbot import *
connect()
def findLetter(word, letter, hidden):
newHidden = ""
for i in range(len(word)):
if word[i] == letter:
newHidden = newHidden + letter
else:
newHidden = newHidden + hidden[i]
return newHidden
print(findLetter("system", "s", "*y**em"))
word = "system"
hidden = ""
for i in range(len(word)):
hidden = hidden + "*"
print(hidden)
guesses = 0
won = False
while guesses < 8 and won == False:
letter = input("Guess a letter: ")
hidden = findLetter(word, letter, hidden)
print(hidden)
guesses = guesses + 1
won = True
for i in range(len(hidden)):
if hidden[i] == "*":
won = False
if won == True:
led("green")
print("You won")
else:
led("red")
print("You lost")
Questions
What are the answers to AQA GCSE Computer Science 2025 Paper 1 Questions 11.1 to 11.4?
11.1 is B, s. 11.2 is A, s. 11.3 is C, 6. 11.4 is C, sys*em.
What is the answer to Question 11.5?
Loop while fewer than 8 guesses have been made and the player has not won. Inside, input a letter, set hidden to findLetter(word, letter, hidden), print hidden, add 1 to the guesses, and check every character of hidden for an asterisk. After the loop print You won or You lost.
How do I check whether a string contains a character without using in?
Loop over the index numbers of the string and compare each character with the one you want, setting a flag when you find it.
More from this paper
- Question 3: A coaching cost with three price bands 8 marks
- Question 4: Validate a name by length until it is accepted, test data, and a username flowchart 13 marks
- Question 5: Data types, and five inputs rewritten as a loop with one 8 marks
- Question 10: Records, and the smallest value in an array without min or sort 8 marks
Every AQA 8525 question we have worked
Learn it step by step
- F4.2 Parameters and return values Functions and structured code
- F3.1 String handling Strings, lists and records
- F13.4 Programming questions Exam preparation
This is our own explanation of a published exam question. It is not written or endorsed by AQA, and the question paper and mark scheme remain AQA's copyright. Read them on AQA's site with the links on this page.