GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.28
Computational thinking and programming
Explain and identify constants
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Explain and identify constants
A constant is a value intended to remain unchanged during the relevant algorithm. Python uppercase naming is a convention that communicates that intention; it does not prevent reassignment.
- Model variables and constants, then identify repeated settings worth naming.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
Writing ITEMS_PER_BOX = 8 explains why the factor 8 is used in several calculations. It is clearer than repeating an unexplained literal and does not make Python enforce immutability.
Try before your workbook
Does writing MAX_ITEMS = 12 stop a later Python statement from assigning MAX_ITEMS = 20?
Explore the clues
Tap one card to find out more.
Understand the idea
A constant is a value intended to remain unchanged during the relevant algorithm. Python uppercase naming is a convention that communicates that intention; it does not prevent reassignment.
Concept to practise: Explain and identify constants.
Work through an example
Writing ITEMS_PER_BOX = 8 explains why the factor 8 is used in several calculations. It is clearer than repeating an unexplained literal and does not make Python enforce immutability.
Try before your workbook
Does writing MAX_ITEMS = 12 stop a later Python statement from assigning MAX_ITEMS = 20?
Check my readiness thinking
No. Uppercase communicates the programmer's intention, but Python still permits reassignment. Keep the intended constant unchanged in the algorithm.
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.
Decide what stays fixed during a run
For a fictional packing activity, the current number of items can change, while the agreed number of items per pack stays fixed. Choose names that explain each role.
Model two separately named stores

Read this model’s labels and values
Agree on four container instructions
| Instruction | Meaning in this model |
|---|---|
| STORE value | Put an initial card into an empty store. |
| READ | Show or say the value, then put the same card back. |
| REPLACE value | Exchange the variable card for the new value. |
| REMOVE | Take out the variable card; it becomes empty. |
Trace the variable container in order
| Instruction | Stored current_count afterwards |
|---|---|
| STORE 8 | {'clue': 'Stored value or empty', 'prompt': 'Variable after store 8', 'answers': ['8']} |
| READ | {'clue': 'Stored value or empty', 'prompt': 'Variable after read', 'answers': ['8']} |
| REPLACE 11 | {'clue': 'Stored value or empty', 'prompt': 'Variable after replacement', 'answers': ['11']} |
| REMOVE | {'clue': 'Stored value or empty', 'prompt': 'Variable after removal', 'answers': ['empty']} |
| STORE 0 | {'clue': 'Stored value or empty', 'prompt': 'Variable after storing zero', 'answers': ['0']} |
Trace the constant container in order
| Instruction | Stored PACK_SIZE afterwards |
|---|---|
| STORE 6 | {'clue': 'Stored value or empty', 'prompt': 'Constant after store 6', 'answers': ['6']} |
| READ | {'clue': 'Stored value or empty', 'prompt': 'Constant after read', 'answers': ['6']} |
| REPLACE 9 (refuse) | {'clue': 'Stored value or empty', 'prompt': 'Constant after refused replacement', 'answers': ['6']} |
| REMOVE (refuse) | {'clue': 'Stored value or empty', 'prompt': 'Constant after refused removal', 'answers': ['6']} |
| READ | {'clue': 'Stored value or empty', 'prompt': 'Constant after final read', 'answers': ['6']} |
Find repeated settings worth naming
Original repeated-literal example
first_units = 4
second_units = 6
first_tokens = first_units * 1.5
second_tokens = second_units * 1.5
print("Tokens:", first_tokens)
print("Tokens:", second_tokens)Identify fixed thresholds in a decision
Original workshop policy
minutes = int(input())
if minutes >= 45:
print("Paper sculpture")
elif minutes >= 20:
print("Pattern tiles")
else:
print("Choose a longer time")Recognise the parts of a constant declaration
| Part | Value from the declaration |
|---|---|
| Keyword | {'clue': 'Exact token', 'prompt': 'Declaration keyword', 'answers': ['CONSTANT']} |
| Identifier | {'clue': 'Exact token', 'prompt': 'Declaration identifier', 'answers': ['PACK_SIZE']} |
| Assignment symbol | {'clue': 'Exact symbol', 'prompt': 'Assignment symbol', 'answers': ['=']} |
| Initial value | {'clue': 'Number', 'prompt': 'Declaration initial value', 'answers': ['6']} |
Distinguish Python convention from enforcement
Demonstration of naming, not protection
PACK_SIZE = 6
PACK_SIZE = 9
print(PACK_SIZE)Explain useful fixed values precisely
A fictional TOKEN_RATE can be edited from 1.5 to 2.0 between runs if the agreed policy changes. Naming it lets the programmer update its one definition, then test every use again. Do not assume this is always a memory-saving optimisation.
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 12 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 7.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 12 worksheets
Worksheet 1
- Question 1: Which is a suitable constant for one packing run? the agreed number of items per pack
- Question 2: Does reading a stored constant need to change its value? no, it can be read repeatedly unchanged
Worksheet 2
- Question 3: Which store may be replaced during this activity run? current_count
Worksheet 3
- Question 4: After READ, where is the original value? still stored in the same container
- Question 5: For a constant after its initial STORE, which actions are refused this run? REPLACE and REMOVE
Worksheet 4
- Question 6: Variable after store 8 8
- Question 7: Variable after read 8
- Question 8: Variable after replacement 11
- Question 9: Variable after removal empty
- Question 10: Variable after storing zero 0
Worksheet 5
- Question 11: Constant after store 6 6
- Question 12: Constant after read 6
- Question 13: Constant after refused replacement 6
- Question 14: Constant after refused removal 6
- Question 15: Constant after final read 6
Worksheet 6
- Question 16: What repeated numeric rate is a candidate for TOKEN_RATE? 1.5
- Question 17: What is first_tokens after the calculation? 6.0 / 6
- Question 18: Which repeated text is worth naming OUTPUT_LABEL? Tokens:
Worksheet 7
- Question 19: Which pair is suitable for named threshold constants? 45 and 20
- Question 20: Which is a meaningful name for the first threshold? SCULPTURE_MINUTES
Worksheet 8
- Question 21: Declaration keyword CONSTANT
- Question 22: Declaration identifier PACK_SIZE
- Question 23: Assignment symbol =
- Question 24: Declaration initial value 6
Worksheet 9
- Question 25: What does this Python demonstration print? 9
- Question 26: Does the uppercase name itself enforce a fixed value? no, the program can still reassign that name
- Question 27: Which design follows our constant intention? assign the setting once and only read it during the run
Worksheet 10
- Question 28: What does 3.14 represent in PI_APPROX? an approximation to pi
- Question 29: When a fixed token-rate policy changes, what should be retested? all calculations that use that setting
Worksheet 11
- Question 30: Label two drawn or physical boxes current_count and PACK_SIZE. Start empty. Model the complete page 4 variable sequence and page 5 constant sequence, recording each requested action, whether accepted and the stored value afterwards. Include the value reported by every READ. Explain empty versus zero and why the constant refuses replacement and removal. Swap instructor/store roles with a partner, or individually trace and explain both roles. State what was actually performed, what help was used and any correction. If a practical round was not done, mark it Pending and supply the individual trace. Variable states 8,8,11,empty,0; READ reports 8. Constant states 6,6,6,6,6; both READs report 6; REPLACE 9 and REMOVE refused. Names separate stores. Empty is no stored card, zero is stored numeric data. Constant starts empty, accepts first STORE then is read without change during one run. Correct individual trace accepted without invented partner/physical performance. Actual role swap/evidence or Pending, corrections and explanation required. Model restriction is a teaching rule, not enforced by uppercase Python names. Grown-up review; personal evidence is required.
Worksheet 12
- Question 31: Use the complete original page 6 calculations and page 7 workshop program. Identify the fixed rate, repeated label and two thresholds, and propose meaningful uppercase names and values for them. Distinguish these settings from changing inputs and calculated results. Rewrite the rate calculation using TOKEN_RATE and OUTPUT_LABEL, preserving both original outputs. Explain how to change the rate to 2.0 between runs, predict both new totals and record actual output or Pending. Explain why uppercase alone does not enforce a constant. Keep your source and evidence with this workbook. Fixed TOKEN_RATE=1.5, OUTPUT_LABEL="Tokens:", SCULPTURE_MINUTES=45 and TILES_MINUTES=20 or equally meaningful names. Inputs first_units=4/second_units=6 and minutes change; calculated token totals vary. Refactoring defines constants once and uses them consistently, preserving Tokens: 6.0 / Tokens: 9.0. Change one rate definition to 2.0 between runs -> Tokens: 8.0 / Tokens: 12.0, normal equivalent numeric displays accepted. Actual/Pending evidence and source required. Uppercase convention only; ordinary assignment permits reassignment, so maintain fixed-value policy by program design. No memory-saving or learner execution claim without evidence. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 113–116
- PaxaKids Grade 8 Computing Lesson 1.28: Explain and identify constants — pages 1–12
Computing for your homeschool day
Explore Explain and identify constants 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.
