GRADE 7 · COMPUTING · UNIT 6 · LESSON 6.2
Sequencing and pattern recognition: Getting the message across
Pattern recognition
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Pattern recognition
Pattern recognition finds a repeated structure that can guide the next steps. The same action may be expressed differently in MakeCode blocks and micro:bit MicroPython. Match the meaning while preserving each editor's API.
- Identify repeated structures in a grid, flowchart or program.
- Match MakeCode blocks with equivalent MicroPython actions and conditions.

Explore the clues
Tap one card to find out more.
Understand the idea
Pattern recognition finds a repeated structure that can guide the next steps. The same action may be expressed differently in MakeCode blocks and micro:bit MicroPython. Match the meaning while preserving each editor's API.
Concept to practise: Pattern recognition.
Work through an example
A triangle, wait, square, wait pattern can be repeated as another complete pair before clear and stop. In MicroPython sleep(500) requests 500 milliseconds, which is half a second.
Try before your workbook
If a loop has two independent if statements and both button conditions are true, can both outputs run? How would an if/elif change the choice?
Check my readiness thinking
Both independent branches can run when their sampled conditions are true, so the second output may replace the first. An if/elif chooses at most one of those branches in that pass. Trace the actual structure instead of treating the forms as interchangeable.
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.
Recognise the part that repeats
In this lesson’s original pattern, the colours repeat green, orange, purple. The sequence begins green, orange, purple, green, orange, purple.
Match actions across representations
| MakeCode block meaning | MicroPython equivalent |
|---|---|
| show icon: Heart | display.show(Image.HEART) |
| pause (ms): 500 | sleep(500) |
| clear screen | display.clear() |
| test: button A is pressed | button_a.is_pressed() |
Use a repeated condition-and-output pattern
Original program model
from microbit import *
while True:
if button_a.is_pressed():
display.show(Image.HAPPY)
if button_b.is_pressed():
display.show(Image.SAD)
sleep(20)Read an unfinished shape-sequence plan
- Start
- Show TRIANGLE
- Wait 500 ms
- Show SQUARE
- Wait 500 ms
Prepare the original starter
Original program model
from microbit import *
display.show(Image.TRIANGLE)
sleep(500)
display.show(Image.SQUARE)
sleep(500)
# Extend the same two-shape pattern once more below.Practice files for this lesson
Save a copy of these original PaxaKids learner files before editing in suitable software. Some code and datasets deliberately need completion or repair. Downloading a file does not run it. Use invented data; record actual tests separately from predictions. Native software practice files are not print-optimised; use the student PDF for printing.

Try one step with Paxa!
Use supplied fictional records. Do not disclose personal details, upload private photos or bypass browser warnings to complete an activity. Save personal responses before leaving.
Our Unit 6 learning path
- Lesson 6.1: Prototyping
- Lesson 6.2: Pattern recognition
- Lesson 6.3: Patterns between text-based programming languages
- Lesson 6.4: Boolean selection and sub-routines
- Lesson 6.5: Project plans and test plans
- Lesson 6.6: Identifying errors and debugging
- Lesson 6.7: Sequences and lights
- Lesson 6.8: Creating a moving sequence of lights
- Lesson 6.9: Extending a light sequence
- Lesson 6.10: Light brightness
- Lesson 6.11: Loading-screen and name-sequence extensions
- Lesson 6.12: Final project: Sound-triggered visual alarm
- Lesson 6.13: Evaluation
- Lesson 6.14: What can you do?
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 the 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 7 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 7 worksheets
Worksheet 1
- Question 1: Which colour comes next? green
- Question 2: Which is the repeating group? green, orange, purple
- Question 3: How can a code pattern help? show which structure to retain and which details to change
Worksheet 2
- Question 4: Which MicroPython call matches clear screen? display.clear()
- Question 5: Which pair expresses a delay of the same duration? pause 500 ms and sleep(500)
Worksheet 3
- Question 6: Which two details change between the conditional branches? the button name and the image name
- Question 7: Why is the while loop important here? it checks again instead of testing each button only once at startup
Worksheet 4
- Question 8: Which output begins the repeated pair that follows? TRIANGLE
Worksheet 5
- Question 9: After completing the requested extension, how many shape-output calls run? 4
- Question 10: What is the total requested waiting time for four 500 ms waits, in milliseconds? 2000
Worksheet 6
- Question 11: Extend the unfinished flowchart from page 4 to show the same triangle/square sequence once more, then clear the display and stop. Include every half-second wait. Write the matching complete MicroPython program or identify your saved source revision. Use appropriate symbols, arrows, order and indentation. Original extension preserves Triangle,wait500,Square,wait500 then Triangle,wait500,Square,wait500,clear,stop. Start/stop terminals; parallelogram outputs; process waits; directed sequential arrows. Code imports microbit and uses Image.TRIANGLE/Image.SQUARE, sleep(500), clear; complete exact file or linked revision. Repeated pair exactly twice, not indefinite unless clearly presented as optional separate enhancement. No fake hardware execution. Grown-up review; personal evidence is required.
Worksheet 7
- Question 12: Discuss the block descriptions and MicroPython with a partner: identify shared words, words with similar meanings, and matching structures. Explain how you used the pattern to extend the flowchart and program. Open your saved source, connect and flash a compatible micro:bit, and record expected versus actual image order and waits, the method/version, any correction and retest. Mark unavailable practical or partner steps Pending. Retains all three source tasks: comparison discussion includes words/meaning/structure; completed repeated triangle/square flowchart; original starter edited, opened, connected and flashed when equipment available. Expected T,S,T,S with four500ms waits, clear and terminate. Actual observations and codeprediction distinguished; source/stub/simulator not physical transfer evidence. Record revision/method and real actuals orPending, correction/retest as needed. No invented partner or result. No numeric scores. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing 7 Student’s Book — pages 189–192
- PaxaKids Grade 7 Computing Lesson 6.2: Pattern recognition — pages 1–7
Computing for your homeschool day
Explore Pattern recognition with this free Grade 7 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.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
The book pages identify the related teaching topic. 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.
