Community resourceWorksheet
Y9-L03 Game night shortlist
Part 3 of 3 · Y9 Lists
Pupils practise looping through a list, using if statements to select or skip items, and building a new list with append. The tasks move from tracing and predicting output to writing a short filtering program with input, so the demand is moderate and suitable for guided practice.
Shared by Mr HopkinsonVerified teacher
- 22 cells
- CC BY-SA 4.0
- Shared 12 Nov 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
Game night shortlist
Loop through a list of game suggestions. Use if to skip the game your group played last time.
Visit every item
range(3) repeats three times. A loop over games repeats once per item.
games = ["Trivia", "Word Hunt"]
for game in games:
print(game)
games is the whole list. game is the loop variable. It holds the current item.
Task 1. Show every suggestion
Fill three gaps. Run, then Check my answer.
Expected output
Kart Race
Trivia
Word Hunt
games = ["Kart Race", "Trivia", "Word Hunt"]
Gap 1 game in Gap 2:
print(Gap 3)- range
- game
- for
- if
- games
- len
Check each item
= stores a value. == checks for equality.
A condition is true or false. Selection uses if to run code when the condition is true.
games = ["Kart Race", "Trivia", "Word Hunt"]
for game in games:
if game == "Trivia":
print(game)
Use four spaces to indent if and eight for print.
| Current item | Condition | What prints? |
|---|---|---|
| Kart Race | False | Nothing |
| Trivia | True | Trivia |
| Word Hunt | False | Nothing |
Task 2. Predict the output
games = ["Trivia", "Dance Battle", "Trivia"]
for game in games:
if game == "Trivia":
print(game)
What does the code print?
- ATrivia once
- BAll three titles
- CTrivia twice
- DDance Battle once
Task 3. Print only Dance Battle
Fill three gaps, then Run. Look for Dance Battle on two lines.
games = ["Dance Battle", "Trivia", "Dance Battle"]
for game in games:
if game Gap 1 Gap 2:
print(Gap 3)- !=
- "Trivia"
- games
- ==
- game
- "Dance Battle"
Task 4. Fix the match
Fix the comparison and print() to show each game that matches wanted.
Run. Expect Trivia on two lines. Select Check my answer.
games = ["Kart Race", "Trivia", "Word Hunt", "Trivia"]
wanted = "Trivia"
for game in games:
if games == wanted:
print(games)Filter the list
Filter means keep items that pass a check. != means does not equal.
games = ["Trivia", "Word Hunt"]
shortlist = []
for game in games:
if game != "Trivia":
shortlist.append(game)
print(shortlist)
append() adds one item to the end. The output is ['Word Hunt'].
Task 5. Skip Kart Race
Fill three gaps. Run and look for ['Trivia', 'Word Hunt'].
games = ["Kart Race", "Trivia", "Kart Race", "Word Hunt"]
shortlist = []
for game in games:
if game Gap 1 "Kart Race":
shortlist.Gap 2(Gap 3)
print(shortlist)- remove
- game
- ==
- games
- !=
- append
Task 6. Explain where the lines go
Use Task 5.
A. What happens to earlier items if shortlist = [] runs at the start of every repeat?
B. What happens to Kart Race if append() runs on every repeat?
Answer A and B in short sentences.
Students type their answer here.
Task 7. Plan two tests
Two people can suggest the same game.
games = ["Kart Race", "Trivia", "Dance Battle", "Kart Race", "Word Hunt"]
| Test | Game to skip |
|---|---|
| A | A title in the list. Copy it exactly. |
| B | A title missing from the list. |
For A and B, give the game to skip and how many suggestions should remain.
Students type their answer here.
Task 8. Build the game night shortlist
Keep the supplied games list unchanged.
- Before the loop, use
input()to save a title to skip. Createshortlist = []. - Loop through
gameswithfor. Useifand!=to append each item that differs from the reply. - After the loop, print two lines. Print the shortlist first, then its length.
Run both tests from Task 7. Select Check my answer.
Syntax reminder
skip = input("Game to skip? ") saves the reply. len(shortlist) counts the items.
games = ["Kart Race", "Trivia", "Dance Battle", "Kart Race", "Word Hunt"]
# Ask which game to skip. Create the empty shortlist.
# Loop through the suggestions and add the games to keep.
# Print the shortlist and its length.Task 9. Save a reminder
Copy your Task 5 code. Label the current item, condition and line after the loop.