GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.21
Computational thinking and programming
Ordered ELIF choices
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Ordered ELIF choices
Python elif continues an ordered choice chain. Put more restrictive conditions first when ranges overlap, and define the fallback. An earlier match prevents later elif branches from running.
- Construct multiple alternatives, add a fallback, arrange thresholds in a meaningful order and compare representations.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
With if points >= 30 followed by elif points >= 15, points 35 enters the first branch. Reversing those conditions would let the broader threshold catch 35 first.
Try before your workbook
For those original thresholds, which branch handles points 20?
Explore the clues
Tap one card to find out more.
Understand the idea
Python elif continues an ordered choice chain. Put more restrictive conditions first when ranges overlap, and define the fallback. An earlier match prevents later elif branches from running.
Concept to practise: Ordered ELIF choices.
Work through an example
With if points >= 30 followed by elif points >= 15, points 35 enters the first branch. Reversing those conditions would let the broader threshold catch 35 first.
Try before your workbook
For those original thresholds, which branch handles points 20?
Check my readiness thinking
The elif points >= 15 branch, because the >= 30 condition is false. Check the order as well as the comparison signs.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Use several ordered alternatives
Conditions are checked in written order until one is true. That branch runs; later alternatives are skipped. If none is true, the fallback else runs when supplied.
Read several exact-match alternatives
Original Paxa tray selector
colour = input()
if colour == "red":
print("Tray A")
elif colour == "blue":
print("Tray B")
elif colour == "green":
print("Tray C")
else:
print("Ask for a tray")
print("Selection complete")Compare a chain with and without a fallback
A: no fallback
colour = input()
if colour == "red":
print("Tray A")
elif colour == "blue":
print("Tray B")
print("Selection complete")B: with fallback
colour = input()
if colour == "red":
print("Tray A")
elif colour == "blue":
print("Tray B")
else:
print("Ask for a tray")
print("Selection complete")Trace matching, unmatched and capitalised text
| Entered string | Branch output |
|---|---|
| red | {'clue': 'Exact branch text', 'prompt': 'Tray selection for red', 'answers': ['Tray A']} |
| blue | {'clue': 'Exact branch text', 'prompt': 'Tray selection for blue', 'answers': ['Tray B']} |
| green | {'clue': 'Exact branch text', 'prompt': 'Tray selection for green', 'answers': ['Tray C']} |
| gold | {'clue': 'Exact branch text', 'prompt': 'Tray selection for gold', 'answers': ['Ask for a tray']} |
| Red | {'clue': 'Exact branch text', 'prompt': 'Tray selection for Red', 'answers': ['Ask for a tray']} |
Arrange original lines and restore indentation
Shuffled line cards; branch actions currently unindented
A print(right, "leads")
B left_count = int(input())
C if left_count == right_count:
D left = input()
E print(left, "leads")
F right_count = int(input())
G else:
H right = input()
I print("Draw")
J elif left_count > right_count:Test equality and both leading teams
| Lark count | Wren count | Exact output |
|---|---|---|
| 5 | 5 | {'clue': 'Output text', 'prompt': 'Team result for 5 and 5', 'answers': ['Draw']} |
| 8 | 3 | {'clue': 'Output text', 'prompt': 'Team result for 8 and 3', 'answers': ['Lark leads']} |
| 2 | 7 | {'clue': 'Output text', 'prompt': 'Team result for 2 and 7', 'answers': ['Wren leads']} |
Put overlapping thresholds in useful order
Specific higher threshold first
minutes = int(input())
if minutes >= 45:
print("Paper sculpture")
elif minutes >= 20:
print("Pattern tiles")
else:
print("Choose a longer time")Check both threshold boundaries
| Minutes | Selected activity |
|---|---|
| 19 | {'clue': 'Exact message', 'prompt': 'Workshop for 19 minutes', 'answers': ['Choose a longer time']} |
| 20 | {'clue': 'Exact message', 'prompt': 'Workshop for 20 minutes', 'answers': ['Pattern tiles']} |
| 44 | {'clue': 'Exact message', 'prompt': 'Workshop for 44 minutes', 'answers': ['Pattern tiles']} |
| 45 | {'clue': 'Exact message', 'prompt': 'Workshop for 45 minutes', 'answers': ['Paper sculpture']} |
| 46 | {'clue': 'Exact message', 'prompt': 'Workshop for 46 minutes', 'answers': ['Paper sculpture']} |
Diagnose a runnable ordering mistake
Intentional wrong-order example
minutes = int(input())
if minutes >= 20:
print("Pattern tiles")
elif minutes >= 45:
print("Paper sculpture")
else:
print("Choose a longer time")Match pseudocode and Python feature by feature
Pseudocode
INPUT minutes
IF minutes >= 45 THEN
OUTPUT "Paper sculpture"
ELSEIF minutes >= 20 THEN
OUTPUT "Pattern tiles"
ELSE
OUTPUT "Choose a longer time"
ENDIFPython 3
minutes = int(input())
if minutes >= 45:
print("Paper sculpture")
elif minutes >= 20:
print("Pattern tiles")
else:
print("Choose a longer time")Match the same algorithm to a flowchart

Read this model’s labels and values
- Before
- input
- INPUT minutes
- Routes
- minutes >= 45
- output
- Paper sculpture
- minutes >= 20
- output
- Pattern tiles
- Otherwise
- Choose a
longer time
Prepare practical tests and a linked poster
For the poster, show one algorithm in three forms and link matching conditions and outputs. Use the supplied poster brief and attach a larger sheet or file if needed. Describe an actual partner review only if one occurred.
Files for this activity
Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Try one step with Paxa!
Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.
Our Unit 1 learning path
- Lesson 1.1: Recall algorithms and representations
- Lesson 1.2: Purpose and conventions of pseudocode
- Lesson 1.3: Input, output and strings
- Lesson 1.4: Identifiers and assignment
- Lesson 1.5: Arithmetic and translation
- Lesson 1.6: Trace and review a sequence
- Lesson 1.7: Conditions and two-way flow
- Lesson 1.8: IF THEN and indentation
- Lesson 1.9: IF THEN ELSE and decision diagrams
- Lesson 1.10: Ordered ELSEIF and fallback ELSE
- Lesson 1.11: Match flowchart and pseudocode branches
- Lesson 1.12: AND, OR and NOT
- Lesson 1.13: Grouping, precedence and review
- Lesson 1.14: Why software searches
- Lesson 1.15: A successful linear search
- Lesson 1.16: An unsuccessful search and termination
- Lesson 1.17: Practise and communicate the search
- Lesson 1.18: Translate conditions into Python
- Lesson 1.19: One-branch IF programs
- Lesson 1.20: Two-way IF ELSE programs
- Lesson 1.21: Ordered ELIF choices
- Lesson 1.22: Ranges and independent decisions
- Lesson 1.23: Boolean operators in Python
- Lesson 1.24: Design and test recommendations
- Lesson 1.25: Trace, debug and reflect
- Lesson 1.26: Choose data types and recognise Boolean literals
- Lesson 1.27: Set and use Boolean flags
- Lesson 1.28: Explain and identify constants
- Lesson 1.29: Express constants in three algorithm forms
- Lesson 1.30: Use a fixed factor in a calculation
- Lesson 1.31: Cast to Boolean and validate an empty response
- Lesson 1.32: Recall calls and trace return values
- Lesson 1.33: Supply parameters and reuse library code
- Lesson 1.34: Choose and import libraries responsibly
- Lesson 1.35: Round with floor and ceiling
- Lesson 1.36: Use pi and investigate another mathematical feature
- Lesson 1.37: Generate random choices within bounds
- Lesson 1.38: Investigate random real values and review library use
- Lesson 1.39: Retrieve test tables and predict selection outcomes
- Lesson 1.40: Decompose everyday problems
- Lesson 1.41: Decompose programs and organise shared work
- Lesson 1.42: Develop through repeated build/test cycles
- Lesson 1.43: Predict and verify algorithm outcomes
- Lesson 1.44: Choose representative and boundary tests
- Lesson 1.45: Build, execute and review a test plan
- Lesson 1.46: Recall physical inputs and compare transmission media
- Lesson 1.47: Configure a radio group and agree a message scheme
- Lesson 1.48: Send and receive numbers and strings
- Lesson 1.49: Trace numeric message sequences
- Lesson 1.50: Transmit text and use received data in conditions
- Lesson 1.51: Diagnose and extend a message protocol
- Lesson 1.52: Review communication and evidence of testing
- Lesson 1.53: Project 1: Adventure story
- Lesson 1.54: Project 2: Fire, Water, Earth
- Lesson 1.55: Check your progress 1
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 14 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.5 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 14 worksheets
Worksheet 1
- Question 1: Which Python keyword adds another tested alternative? elif
- Question 2: What happens after the first true condition in one chain? its block runs and later alternatives are skipped
Worksheet 2
- Question 3: Where must the fallback else appear? after all elif alternatives in its chain
- Question 4: Which headers must line up here? if, elif and else
Worksheet 3
- Question 5: What does version A print for gold? Selection complete only
- Question 6: What does version B print for gold? Ask for a tray then Selection complete
Worksheet 4
- Question 7: Tray selection for red Tray A
- Question 8: Tray selection for blue Tray B
- Question 9: Tray selection for green Tray C
- Question 10: Tray selection for gold Ask for a tray
- Question 11: Tray selection for Red Ask for a tray
Worksheet 5
- Question 12: Write the card IDs in program order, separated by commas. D,H,B,F,C,I,J,E,G,A
- Question 13: Which three action-card IDs need four leading spaces? Write alphabetically. A,E,I
Worksheet 6
- Question 14: Team result for 5 and 5 Draw
- Question 15: Team result for 8 and 3 Lark leads
- Question 16: Team result for 2 and 7 Wren leads
- Question 17: After equality has been ruled out, what does the final else cover? the right count is greater
Worksheet 7
- Question 18: For 50 minutes, how many workshop branch messages print? one
- Question 19: Why does >= 45 come before >= 20 here? a long session satisfies both comparisons but needs the longer activity
Worksheet 8
- Question 20: Workshop for 19 minutes Choose a longer time
- Question 21: Workshop for 20 minutes Pattern tiles
- Question 22: Workshop for 44 minutes Pattern tiles
- Question 23: Workshop for 45 minutes Paper sculpture
- Question 24: Workshop for 46 minutes Paper sculpture
Worksheet 9
- Question 25: What activity does this wrong-order version print for 50? Pattern tiles
- Question 26: Why can its Paper sculpture branch never be selected for valid minutes? every value at least 45 already matches the earlier >= 20 test
- Question 27: Which repair preserves the intended activity mapping? place >= 45 and its action before >= 20 and its action
Worksheet 10
- Question 28: Which Python feature matches pseudocode ELSEIF? elif with a condition and colon
- Question 29: Which Python feature shows where a branch block ends? a return to the earlier indentation level
Worksheet 11
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 12
- Question 30: Which test proves the fallback is handled in the tray program? gold
- Question 31: Which poster is consistent? all three forms choose Paper sculpture at exactly 45
Worksheet 13
- Question 32: Reconstruct the page 5 team program with the supplied input order and four-space action blocks. Save full code or write it clearly. Predict and test equality, left-leading and right-leading cases from page 6. Then enter or open the complete tray selector and test all five page 4 strings. Annotate if/elif/else, the comparisons, branch actions and shared output where present. Compare predictions with actual output or mark execution Pending. Record a correction and retest if needed. Use actual peer review if available; otherwise label individual review. Cite the full code and test-record files. Team order D,H,B,F,C,I,J,E,G,A, indent I/E/A four spaces; names read then counts, equality Draw, otherwise left lead then right lead. All quotes complete; do not reproduce source missing closing quote. Team tests 5/5 Draw,8/3 Lark leads,2/7 Wren leads with names Lark/Wren. Tray red/A,blue/B,green/C,gold/Ask,Red/Ask; Selection complete follows every branch. Full source and exact prediction/actual or Pending evidence, syntax and annotation correct; correction/retest if needed and honest individual/partner stage. No invented GUI or numeric marks. Grown-up review; personal evidence is required.
Worksheet 14
- Question 33: Make a Flowchart to Pseudocode to Python poster for the workshop rule on pages 7–11. Show the same input, ordered thresholds, three outputs and stopping paths in all forms. Include IF/THEN, ELSEIF, ELSE and ENDIF in pseudocode; if, elif, else, colons and four-space blocks in Python; and labelled True/False arrows in the flowchart. Link corresponding decisions and actions. Use this space to plan or cite a larger attached poster. Check all five page 8 inputs across all representations and record any correction. Same valid integer minutes domain 0–120, >=45 Paper sculpture, otherwise >=20 Pattern tiles, otherwise Choose a longer time. Flowchart input/parallelogram, two decisions/diamonds ordered 45 then 20 via false path, labelled True/False, one matching output, joined Stop; Python/pseudocode semantically identical with correct language syntax/indentation. Corresponding features linked, no backwards/rerun path. Five cases 19/20/44/45/46 match all forms. Original poster or actual attached file and concrete evidence; no invented production or peer review. No numerical marks. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 84–92
- PaxaKids Grade 8 Computing Lesson 1.21: Ordered ELIF choices — pages 1–14
Computing for your homeschool day
Explore Ordered ELIF choices with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
