← Years 5–6 Creating Digital Solutions

Comparison blocks: >, < and =

A comparison block checks two values and reports true or false. This one is true when the score variable is greater than 10. Use < for less than and = for equal to.

Understanding Comparison blocks: >, < and = in Years 5–6 Creating Digital Solutions

What it does: The = block compares the answer variable to 7 and reports true only if they are the same number. 15 is greater than 10, so score > 10 is true. 15 is not less than 10, so score < 10 is false. The = block checks if two values are equal. lives > 0 would check if there are some lives left.

Common mistakes: The program says the score is over 10, so it needs 'greater than' (>). With < the block checks for less than 10, which is false when the score is 12. It should be: if score > 10 then. The equals comparison block uses a single = sign, not two. It should be: if lives = 0 then.

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 51–60) and word search (Modules 41–74).

Take this worksheet further — free with Cloodit

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

Learning
Duo
What does a comparison block like score > 10 report?
true or falseA number
Matches
if score > 10 then say 'Win' (checking for exactly 10 using >)
↓
Using > when you want to check for exactly 10. The > block is false when the score is 10. Use = instead.
Applying
Meanings
Term
score > 10
Meaning
A comparison block checks two values and reports true or false. This one is true when the score variable is greater than 10. Use < for less than and = for equal to.
Practice
score > 10
Testing
Gaps
if <score 10> then
Check Answer
Spots
2set score to 12
3if score < 10 then

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

The 'Butterfly' badge — Branch Hopper, 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. What does a comparison block like score > 10 report?
A. true or false ✓
B. A number
A comparison block always reports true or false. It checks two values and tells you if the comparison is true.
2. The score variable is 15. Which block is true?
A. score > 10 ✓
B. score < 10
15 is greater than 10, so score > 10 is true. 15 is not less than 10, so score < 10 is false.
3. Which symbol means 'less than'?
A. >
B. < ✓
The < symbol means less than. The > symbol means greater than.
4. The lives variable is 3. What does lives = 3 report?
A. false
B. true ✓
The variable lives is 3, and 3 is equal to 3, so the block reports true.
5. The score variable is 4. What does score > 10 report?
A. false ✓
B. true
4 is smaller than 10, so it is not greater than 10. The block reports false.

Match the Pairs

score > 10 → Reports true when the score variable is greater than 10, otherwise false
lives < 3 → Reports true when the lives variable is less than 3, otherwise false
An equals block is true only when both values are exactly the same → answer = 7
Comparing a variable to a number to see if it is bigger than the number → timer > 30
if score > 10 then say 'Win' (checking for exactly 10 using >) → Using > when you want to check for exactly 10. The > block is false when the score is 10. Use = instead.
lives < 0 (to check the player has no lives left) → Using < 0 means less than 0, which is never true for lives that stop at 0. Use lives = 0 to check for no lives.

Key Term

score > 10
A comparison block checks two values and reports true or false. This one is true when the score variable is greater than 10. Use < for less than and = for equal to.

Fill in the Blanks

1. if <score > 10> then
Hint: Type the comparison symbol that means greater than.
2. if <lives < 3> then say (Careful!) for 2 seconds
Hint: Type the comparison symbol that means less than.
3. if <answer = 7> then say (Correct!) for 2 seconds
Hint: Type the comparison symbol that checks if two values are equal.
4. set score to 12 if <score > 10> then say (You win!) for 2 seconds
Hint: Type the name of the variable that is being compared to the number.
5. set score to 8 <score < 10> reports true
Hint: Type the word a comparison block reports when the check is correct.

Spot the Error

Question 1
A when green flag clicked
B set score to 12
C if score < 10 then
D say Your score is over 10!
E end
Line C — The program says the score is over 10, so it needs 'greater than' (>). With < the block checks for less than 10, which is false when the score is 12. It should be: if score > 10 then.
Question 2
A set lives to 0
B if lives == 0 then
C say Game over
D end
Line B — The equals comparison block uses a single = sign, not two. It should be: if lives = 0 then.
Question 3
A if age > 10 then
B say You are under 10
C else
D say You are 10 or older
E end
Line A — The message says the person is under 10, so the block must use 'less than' (<). It should be: if age < 10 then.
Question 4
A if score > then
B say Top score!
C end
Line A — A comparison block needs two values, one on each side of the symbol. The number 10 is missing. It should be: if score > 10 then.
Question 5
A set coins to 7
B if coins is 7 then
C say I have 7 coins
D end
Line B — There is no 'is' comparison block. To check if two values are equal, use the = block. It should be: if coins = 7 then.

Student with a class code? Join your class →