GRADE 7 · COMPUTING · UNIT 1 · LESSON 1.4

Block it out: Moving from blocks to text

Variables

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

6 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Variables

A variable is a name bound to a value. Assignment stores a value for later use; later assignment can replace it. Quoted text is literal text, while an unquoted variable name asks Python for its current value. Use invented practice information, not a real address.

Today’s two goals
  • Assign values to clearly named variables.
  • Combine literal text and variable values in output statements.
Original PaxaKids illustration for Variables. Precise program text and data are supplied in the workbook models.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Explore the clues

Tap one card to find out more.

Understand the idea

A variable is a name bound to a value. Assignment stores a value for later use; later assignment can replace it. Quoted text is literal text, while an unquoted variable name asks Python for its current value. Use invented practice information, not a real address.

Concept to practise: Variables.

Work through an example

After member = "Maya", print(member) displays Maya, whereas print("member") displays member. If member is then assigned "Sami", the next print(member) uses Sami because it reads the current binding.

Try before your workbook

After colour = "Blue" and then colour = "Green", what does print(colour) show? What would print("colour") show instead?

Check my readiness thinking

The first displays Green, the latest stored value. The second displays colour because quotation marks make it literal text rather than a variable lookup.

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.

Give useful names to values

Our goal: assign values to variables, combine values with messages and test a changed profile.

A variable name refers to a value used by a program. In member = "Maya", = assigns the string "Maya" to the name member. This profile is fictional; you can use invented details for every task.

Read the fictional profile

club_profile.py
member = "Maya"
age = 12
club = "Coding"
colour = "Blue"
print("Member:", member)
print("Age:", age)
print("Club:", club)
print("Colour:", colour)

A quoted name is literal text

PROGRAM A
member = "Maya"
print(member)
PROGRAM B
member = "Maya"
print("member")

Change a value, then test

Sami copies the page B program. He changes member to "Sami" and colour to "Green". He keeps age = 12 and club = "Coding". The output instructions still use the same variable names, so they use the newly assigned values.

Discussion: Explain why the print instructions do not need to be rewritten when only these assigned values change.

Build and change a profile

Type the complete page B program in an approved Python3 Editor. Save it as club_profile.py and run it. Then replace all four values with other fictional values, keeping age as a whole number. Predict the new output, save and run again. If working on paper, clearly label your output as a trace.

Explain a misleading output

A RUNNABLE MISTAKE
club = "Robotics"
print("Club:", "club")
Paxa the Fox

Try one step with Paxa!

Trace code carefully and preserve exact spelling, case and order. Use invented practice data. Save personal responses before leaving.

Our Unit 1 learning path
  1. Lesson 1.1: Comparing Scratch and Python
  2. Lesson 1.2: Using Python
  3. Lesson 1.3: Using Python IDLE in Script mode
  4. Lesson 1.4: Variables
  5. Lesson 1.5: Adding more information to a program
  6. Lesson 1.6: Data types – string, integer and real
  7. Lesson 1.7: Casting
  8. Lesson 1.8: Flowcharts and algorithms
  9. Lesson 1.9: BIDMAS in Python
  10. Lesson 1.10: Error detection and correction
  11. Lesson 1.11: Making choices IF THEN ELSE in flowcharts
  12. Lesson 1.12: Sub-routines
  13. Lesson 1.13: Random questions and a star number
  14. Lesson 1.14: Final project
  15. Lesson 1.15: Evaluation
  16. Lesson 1.16: 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.

Variables6 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

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

Download worksheet PDF ↓

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

  1. Question 1: Which part is the variable name in member = "Maya"? member
  2. Question 2: What does = do in this assignment? assigns a value to the name

Worksheet 2

  1. Question 3: What value is assigned to age? 12
  2. Question 4: What word is printed after Club:? Coding
  3. Question 5: Which line displays the stored colour? print("Colour:", colour)

Worksheet 3

  1. Question 6: What does Program A display? Maya
  2. Question 7: What does Program B display? member
  3. Question 8: Why do the outputs differ? one looks up a value; the other prints literal text

Worksheet 4

  1. Question 9: What word will now appear after Member:? Sami
  2. Question 10: What word will now appear after Colour:? Green
  3. Question 11: Which two values stay the same? age and club

Worksheet 5

  1. Question 12: Record the four original output lines and the four changed output lines. Include the changed assignments and explain how your test shows that the output uses the stored values. Original lines: Member: Maya; Age:12; Club: Coding; Colour: Blue, with a space after each colon. Changed lines must match the learner’s four new fictional values and preserve labels. Look for correct assignments, quoted strings, an unquoted whole-number age, saved code or labelled paper trace, and a causal explanation of variable lookup. Grown-up review; personal evidence is required.

Worksheet 6

  1. Question 13: State the actual output, then write a corrected print instruction and its expected output. Explain precisely why removing one pair of quotation marks changes the result. Actual: Club: club. Corrected instruction: print("Club:", club), with matching single quotes also acceptable for the label. Correct output: Club: Robotics. The quoted"club"is literal text; unquoted club retrieves the value assigned to that variable. Require a concrete explanation and syntactically complete code, not a general claim that all quotation marks should be removed. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Variables 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.