← ACARA Digital Technologies Years 7–8

Scratch variable blocks as Python assignment

Python for the Scratch block 'change score by 1'. Python works out the right side first, then stores the answer back in score. Use score = 0 to set it.

Understanding Scratch variable blocks as Python assignment in ACARA Digital Technologies Years 7–8

What it does: Changing by a negative number means subtracting, so Python works out score - 1 and stores it back in score. If score is 5, the right side score + 1 becomes 6, and then 6 is stored back in score. The = sign stores a value in a variable. score = 0 sets score to 0, just like the Scratch set block. To go down by 1, take 1 away from the old value. score = -1 would set the score to -1 instead of changing it. Set the starting value first. If you reset to 0 after adding, the +1 is wiped out and score ends at 0.

Common mistakes: The variable being changed must be on the left of the = sign. Python works out the right side first and stores it in the left. It should be score = score + 1. == compares two values. It does not set the variable, so score never exists. To set score to 0 (like the Scratch 'set score to 0' block), use a single =: score = 0.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 482–519) and word search (Modules 420–519).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which Python line matches the Scratch block 'set score to 0'?
score = 0score + 0
Matches
score + 1
↓
This works out an answer but never stores it. Without score = at the start, score does not change, so it does not match 'change score by 1'.
Applying
Meanings
Term
score = score + 1
Meaning
Python for the Scratch block 'change score by 1'. Python works out the right side first, then stores the answer back in score. Use score = 0 to set it.
Practice
score = 0
Testing
Gaps
score =
Check Answer
Spots
2score = score + 1
3score + 1 = score

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Fox' badge — Cunning Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which Python line matches the Scratch block 'set score to 0'?
A. score = 0 ✓
B. score + 0
The = sign stores a value in a variable. score = 0 sets score to 0, just like the Scratch set block.
2. Which Python line matches the Scratch block 'change score by 1'?
A. score = score + 1 ✓
B. score = 1
The block adds 1 to the old value. score = 1 would set the score to 1 and forget what it was before.
3. score is 5. What is score after score = score + 1 runs?
A. 6 ✓
B. 5
Python works out the right side first (5 + 1 = 6), then stores 6 back in score.
4. Which Python line matches the Scratch block 'change score by -1'?
A. score = -1
B. score = score - 1 ✓
To go down by 1, take 1 away from the old value. score = -1 would set the score to -1 instead of changing it.
5. In score = score + 1, which side does Python work out first?
A. The left side (score)
B. The right side (score + 1) ✓
Python works out the right side first, then stores the answer in the variable on the left.

Match the Pairs

score = 0 → Does the same job as the Scratch block 'set score to 0'. It puts the starting value 0 into the variable score.
score = score + 1 → Does the same job as the Scratch block 'change score by 1'. Python works out score + 1 first, then stores the answer back in score.
The Scratch block 'change score by -1' takes one point away from score. → score = score - 1
Python works out the right side of an assignment first, using the old value of score, and then saves the answer in score. → score = score + 1
score + 1 → This works out an answer but never stores it. Without score = at the start, score does not change, so it does not match 'change score by 1'.
score == 0 → A double equals sign compares values and asks a question. It does not set score. Use a single equals sign to match 'set score to 0'.

Key Term

score = score + 1
Python for the Scratch block 'change score by 1'. Python works out the right side first, then stores the answer back in score. Use score = 0 to set it.

Fill in the Blanks

1. score = 0
Hint: Type the starting value that the Scratch block 'set score to 0' uses.
2. score = score + 1
Hint: Type the variable name whose current value Python reads first on the right side.
3. score = score - 1
Hint: Type the operator that makes 'change score by -1' take one away.
4. score = 0 score = score + 1
Hint: Type the symbol that stores the worked-out answer back into the variable.
5. # change score by 5 score = score + 5
Hint: Type the amount that the comment says the Scratch block changes the score by.

Spot the Error

Question 1
A score = 0
B score = score + 1
C score + 1 = score
D print(score)
Line C — The variable being changed must be on the left of the = sign. Python works out the right side first and stores it in the left. It should be score = score + 1.
Question 2
A score == 0
B score = score + 1
C print(score)
Line A — == compares two values. It does not set the variable, so score never exists. To set score to 0 (like the Scratch 'set score to 0' block), use a single =: score = 0.
Question 3
A lives = 3
B lives = live - 1
C print(lives)
Line B — The variable name is spelled wrongly. Python does not know 'live', so it gives a NameError. The Scratch block 'change lives by -1' is lives = lives - 1.
Question 4
A score = 0
B score = Score + 1
C print(score)
Line B — Python is case-sensitive, so Score is a different name from score and does not exist. It should be score = score + 1.
Question 5
A score = 10
B score = score + 5
C score - 1
D print(score)
Line C — This works out score - 1 but never stores the answer anywhere, so score stays the same. To match 'change score by -1', write score = score - 1.

Student with a class code? Join your class →