GRADE 6 · COMPUTING · UNIT 4 · LESSON 4.6
Computer systems
Trace loops and diagnose programming errors
Learn the idea, try your workbook and explain your thinking.
LET’S LOOK, THINK AND TRY
Trace loops and diagnose programming errors
Paxa and Maya model an original counter with paper cards. Set number to 3. Repeat four times: record the current number, then add 3.
- Trace loops and diagnose programming errors.
- trace the supplied model step by step and justify my result.

Separate the language from its tools
A programming language supplies the rules and commands used to express a program. A programming environment provides tools such as an editor, a way to run code and an output area. Blocks and typed text can represent the same algorithm. Follow the condition and order rather than judging by appearance. Text-based code requires accurate syntax; block-based tools can reduce some syntax errors. The most suitable choice depends on the task and learner.
Work through the example: Read the matching text program
This Python 3 example implements the paper algorithm. range(4) gives four iterations; the loop variable count takes values 0, 1, 2, 3, but the program prints number, not count. The indented lines belong to the loop.

Why this helps: A programming language supplies the rules and commands used to express a program. A programming environment provides tools such as an editor, a way to run code and an output area. Blocks and typed text can represent the same algorithm. Follow the condition and order rather than judging by appearance. Text-based code requires accurate syntax; block-based tools can reduce some syntax errors. The most suitable choice depends on the task and learner.
Try it before the workbook
What starting value is specified?
Use the explanation to choose a reason. This first workbook question helps you check that you are ready.
Explore the clues
Open one card at a time.
Remember the idea
A programming language supplies the rules and commands used to express a program. A programming environment provides tools such as an editor, a way to run code and an output area. Blocks and typed text can represent the same algorithm. Follow the condition and order rather than judging by appearance. Text-based code requires accurate syntax; block-based tools can reduce some syntax errors. The most suitable choice depends on the task and learner.
Check your first try
3
Paxa and Maya model an original counter with paper cards. Set number to 3. Repeat four times: record the current number, then add 3. A trace records the values in execution order. The final value after an increment can differ from the last value already output.
Explain with evidence
Use the supplied starting value, step and four iterations.

Think safely with Paxa!
Use the supplied device and data models. Ask a grown-up before connecting equipment, installing software or creating an account.
Use the actual records and labels to explain your answer.
Our Unit 4 learning path
- Lesson 4.1: Identify components and explain their roles
- Lesson 4.2: Compare specifications, costs and useful life
- Lesson 4.3: Create and review a component guide
- Lesson 4.4: Evaluate computer choices with evidence
- Lesson 4.5: Compare languages and programming environments
- Lesson 4.6: Trace loops and diagnose programming errors
- Lesson 4.7: Build and compare two counting programs
- Lesson 4.8: Test, debug and justify an environment choice
- Lesson 4.9: Explain digitisation and storage units
- Lesson 4.10: Encode data and convert storage quantities
- Lesson 4.11: Investigate an original digital sound file
- Lesson 4.12: Evaluate storage plans and unit claims
- Lesson 4.13: Distinguish processing, working memory and storage
- Lesson 4.14: Trace a paper processor and saved state
- Lesson 4.15: Investigate working copies, saving and reopening
- Lesson 4.16: Evaluate processor and memory claims with evidence
- Lesson 4.17: Explain an industrial robot system
- Lesson 4.18: Plan and test a paper robot route
- Lesson 4.19: Test an original sorting robot simulation
- Lesson 4.20: Evaluate robotic production with balanced evidence
- Lesson 4.21: Design and justify a computer and robot system
For grown-ups: using this lesson
Explore the explanation and model together, then try the workbook. 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.
Opening or checking a page does not complete the lesson. Choose “Mark lesson finished” when ready. Optional account progress saves the selected grade, lesson position and completion across devices. Personal workbook responses remain in this tab; save your copy before leaving. Use fictional data and supervised devices; do not share passwords, contact details or real personal records.
2. Fill in your workbook
Read each page’s explanation and use its own diagrams, labels and supplied records. Choose, write or draw. Use Answer list for larger controls.
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 6 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.4 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 6 worksheets
Worksheet 1
- Question 1: What starting value is specified? 3
- Question 2: Which order does one iteration follow? b) Output first, then add 3
Worksheet 2
- Question 3: How many times does the loop body run? 4
- Question 4: What is the third value printed? 9
Worksheet 3
- Question 5: What is the second output? 6
- Question 6: What is the last output? 12
- Question 7: What is the final number value after the loop? 15
Worksheet 4
- Question 8: What is the first output of this changed program? 6
- Question 9: What is its last output? 15
- Question 10: How would you restore the intended output sequence? b) Print number before adding 3
Worksheet 5
- Question 11: What is missing from print(number ? b) A closing parenthesis
- Question 12: What evidence best checks a whole output sequence? b) An ordered output log or trace
Worksheet 6
- Question 13: Trace the intended outputs and final value, then explain the effect of adding before output. Intended: output 3, 6, 9, 12; final number 15. Add-before-output changes outputs to 6, 9, 12, 15 while still ending at 15. Restore print-before-add to meet the original brief. State the initial value, step, repeat count and order. Grown-up review.
- Question 14: Describe how to distinguish and investigate a syntax error and a logic error. Syntax example print(number lacks a closing parenthesis; use the language error message and fix the structure. A runnable but wrong output sequence is a logic mismatch; trace actual values against expected outputs, identify order/count/reset differences, change one cause and retest. Preserve a complete ordered log rather than only a final bubble. Grown-up review.
Curriculum & workbook reference
- Cambridge Primary Computing Learner’s Book 6 — pages 201–208
- PaxaKids Grade 6 Computing Lesson 4.6: Trace loops and diagnose programming errors — pages 1–6
Computing for your homeschool day
Explore Programming environments with this free Grade 6 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
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.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
The book pages identify the related teaching or assessment. These explanations, projects, review activities and student workbooks are original PaxaKids companion materials. These activities include paper alternatives. No separate publisher Workbook or proprietary digital project files are needed.
