GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.25
Computational thinking and programming
Trace, debug and reflect
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Trace, debug and reflect
Debugging compares intended behaviour with actual or traced behaviour. Locate the first meaningful mismatch, change the cause and retest the affected cases. Do not claim a program is correct merely because one test passes.
- Explain outputs and repair keyword, equality, colon, indentation, ELSE placement and Boolean-expression mistakes.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
A rule meant to include 10 uses x > 10 and rejects 10. An independent expected result shows the boundary mistake; change the comparison to >= and retest values below, at and above 10.
Try before your workbook
Which three nearby integer inputs help retest the corrected threshold of at least 10?
Explore the clues
Tap one card to find out more.
Understand the idea
Debugging compares intended behaviour with actual or traced behaviour. Locate the first meaningful mismatch, change the cause and retest the affected cases. Do not claim a program is correct merely because one test passes.
Concept to practise: Trace, debug and reflect.
Work through an example
A rule meant to include 10 uses x > 10 and rejects 10. An independent expected result shows the boundary mistake; change the comparison to >= and retest values below, at and above 10.
Try before your workbook
Which three nearby integer inputs help retest the corrected threshold of at least 10?
Check my readiness thinking
Use 9, 10 and 11, expecting reject, accept and accept. Record actual results separately so a prediction is not mistaken for execution.
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.
Trace, repair and explain your evidence
Start from the intended rule, predict a useful test, examine the code and compare actual behaviour if you execute it. Record the change and retest. This review uses original examples and completes the selection-topic checklist.
Review blocks and a simple equality boundary
Original Paxa review trace
value = 8
if value < 8:
print("Open")
else:
print("Closed")Review ELIF execution and unchanged values
Original Paxa assignment trace
first = "go"
second = "stop"
total = 7
if first == "stop":
total = 11
elif second == "stop":
total = 23
print(total)Repair keyword, comparison and header punctuation
Incorrect headers A and B
A IF parcels >= 4:
B if parcels = 4:Incorrect headers C and D
C if parcels >= 4
D if parcels => 4:Repair indentation rather than only appearance
A: missing action indent
if count >= 4:
print("Ready")
else:
print("Wait")B: wrong else alignment
if count >= 4:
print("Ready")
else:
print("Wait")Use elif and put else last
A: wrong alternative keyword
if count < 4:
print("Small")
else if count < 8:
print("Medium")
else:
print("Large")B: fallback before a test
if count < 4:
print("Small")
else:
print("Large")
elif count < 8:
print("Medium")Give one fallback its colon and block
A: incomplete else header
if count < 4:
print("Small")
else
print("Large")B: duplicate fallback
if count < 4:
print("Small")
else:
print("Large")
else:
print("Other")Repair complete Boolean expressions
Incorrect headers A and B
A if count > 0 and:
B if count > 0 AND limit < 8:Incorrect headers C and D
C if count > 0 not:
D if kind == "art" or "science":Distinguish valid syntax from correct logic
Intentional wrong-order logic example
minutes = int(input())
if minutes >= 20:
print("Short activity")
elif minutes >= 45:
print("Long activity")
else:
print("More time needed")Plan a complete integrated repair
Original Paxa repair task; intentional errors
count = int(input())
kind = input()
IF count = 6 AND kind == "art"
print("Pack")
else if count >= 3:
print("Shared")
else:
print("Wait")
print("Checked")Predict the repaired program before running it
| Count | Kind | First output |
|---|---|---|
| 6 | art | {'clue': 'Exact output', 'prompt': 'Corrected integrated output for 6/art', 'answers': ['Pack']} |
| 5 | art | {'clue': 'Exact output', 'prompt': 'Corrected integrated output for 5/art', 'answers': ['Shared']} |
| 6 | science | {'clue': 'Exact output', 'prompt': 'Corrected integrated output for 6/science', 'answers': ['Shared']} |
| 2 | art | {'clue': 'Exact output', 'prompt': 'Corrected integrated output for 2/art', 'answers': ['Wait']} |
| 6 | ART | {'clue': 'Exact output', 'prompt': 'Corrected integrated output for 6/ART', 'answers': ['Shared']} |
Review five selection skills using real evidence
| ID | Skill |
|---|---|
| 1 | Trace a Python if/elif/else chain. |
| 2 | Write a Python if/elif/else chain. |
| 3 | Write a chain with more than one elif. |
| 4 | Trace selection using and, or and not. |
| 5 | Write selection using and, or and not. |
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.2 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 starts a conditional statement? if
- Question 2: What proves that a runnable program follows its policy? appropriate tests with outputs compared to the stated rule
Worksheet 2
- Question 3: How does Python identify the statements inside a block? consistent indentation
- Question 4: What exact output does this program print? Closed
- Question 5: What is the largest number of else blocks in one chain? 1
Worksheet 3
- Question 6: What number prints for the code exactly as shown? 23
- Question 7: If both first and second are go instead, what number prints? 7
- Question 8: If first is stop, is the elif condition evaluated? no, the first branch was selected
Worksheet 4
- Question 9: Correct A. if parcels >= 4:
- Question 10: Correct B. if parcels == 4:
- Question 11: Correct C. if parcels >= 4:
- Question 12: Correct D. if parcels >= 4:
Worksheet 5
- Question 13: Which change fixes A? indent print("Ready") by four spaces
- Question 14: Which change fixes B? align else with if and indent its print by four spaces
Worksheet 6
- Question 15: Which keyword replaces else if in A? elif
- Question 16: Which structural change fixes B? move the elif condition and Medium action before else
Worksheet 7
- Question 17: Write the corrected else header for A. else:
- Question 18: Which repair makes B match its stated two-outcome rule? remove the second else and its Other action
Worksheet 8
- Question 19: Write the corrected A header. if count > 0 and count < 8:
- Question 20: Write the lowercase Boolean operator required in B. and
- Question 21: Write the corrected C header, using not and grouping parentheses. if not (count > 0):
- Question 22: Write the complete corrected D header. if kind == "art" or kind == "science":
Worksheet 9
- Question 23: What does this version actually print for input 45? Short activity
- Question 24: Which correction implements the policy? test >= 45 with Long activity before >= 20 with Short activity
Worksheet 10
- Question 25: Which first header implements the stated rule? if count >= 6 and kind == "art":
- Question 26: Which line must remain outside the chain? print("Checked")
Worksheet 11
- Question 27: Corrected integrated output for 6/art Pack
- Question 28: Corrected integrated output for 5/art Shared
- Question 29: Corrected integrated output for 6/science Shared
- Question 30: Corrected integrated output for 2/art Wait
- Question 31: Corrected integrated output for 6/ART Shared
Worksheet 12
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 13
- Question 32: Create an original program that reads a fictional year-group integer. Use this complete policy: 7 prints Explore basics; 8 prints Develop ideas; 9 prints Extend projects; every other integer prints Ask adviser. Use if, at least two elif alternatives and one final else with four-space actions. Test 7, 8, 9, 6 and 11, recording predictions and actual output or Pending. Cite full code and tests if saved. Then give Ready, Practising or Pending plus exact evidence for each of the five page 12 skills, including Boolean work from this or earlier selection lessons. Identify one next step. Year int input, exact if year == 7 -> Explore basics; elif ==8 -> Develop ideas; elif ==9 -> Extend projects; else Ask adviser. Valid domain any integer, malformed-text handling not assumed. Five required cases outputs correspond, full code/records, predictions/actual or Pending, at least two elif and single final else aligned with four-space actions. All five source skill meanings preserved in order with nonnumeric status and precise actual evidence; Boolean-writing/tracing may cite lessons 1.23/1.24 or repaired examples. No unsupported confidence claim, numeric marks or fabricated execution. Grown-up review; personal evidence is required.
Worksheet 14
- Question 33: Repair the complete page 10 program to match its stated policy. Keep the full corrected source or cite its saved file. Explain each change: lowercase if, inclusive comparison, lowercase and, missing colon, first-action indentation and elif spelling. Use all five page 11 cases and show both expected output lines. Run the same inputs if possible, record actual output or Pending, and retest any further change. Explain why count 6 with science selects Shared and why Checked must remain unindented. Describe individual work or actual help received honestly. Correct full program matches supplied specification: count int, kind string; if count >= 6 and kind == "art": indented Pack; elif count >=3: Shared; else Wait; Checked outside. Explain six named changes, including replacing assignment-like = by intended >= rather than merely == because policy is inclusive. Tests 6/art Pack,5/art Shared,6/science Shared,2/art Wait,6/ART Shared; every valid case followed by Checked. Exact case, first-match reasoning, complete source and prediction/actual/Pending records, correction/retest evidence and actual help documented. No unperformed GUI activity or numeric marks. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 102–105
- PaxaKids Grade 8 Computing Lesson 1.25: Trace, debug and reflect — pages 1–14
Computing for your homeschool day
Explore Trace, debug and reflect 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.
