icon-background-square
New
New
Year 10
AQA

Relational operators

I can use relational operators as part of selection statements.

icon-background-square
New
New
Year 10
AQA

Relational operators

I can use relational operators as part of selection statements.

warning

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

Lesson details

Key learning points

  1. Relational operators are used to compare values in expressions.
  2. Expressions either return as True or False.
  3. Relational operators can be used in selection statements.

Keywords

  • Relational operator - compare two values and produce the result of True or False

  • Condition - an expression that evaluates to True or False

  • Selection - used when there is more than one possible path for a program to follow

Common misconception

The = operator is used for comparison.

When using Python for programming the == operator is used for comparison and the = operator is used for assignment. Other languages may not always use these operators for these tasks.


To help you plan your year 10 computer science lesson on: Relational operators, download all teaching resources for free and adapt to suit your pupils' needs...

Pupils need to be familar with the relational operators ==, !=, > and <. If required, spend more time checking they understand each operator and how it is used to compare values.
speech-bubble
Teacher tip
equipment-required

Equipment

All pupils requires access to devices that can edit and run Python programs. Starter code files are available to copy or use directly via the Raspberry Pi Code Editor.

copyright

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

6 Questions

Q1.
What does integer division // do?
returns the exact result of a division
rounds the result to the nearest whole number
Correct answer: discards the remainder and keeps only the whole number part
returns only the remainder of a division
Q2.
What comes first in the order of operations?
indicies
multiplication and division
addition and subtraction
Correct answer: Brackets
Q3.
The expression `25 % 4` returns .
Correct Answer: 1
Q4.
Match the operator with its function.
Correct Answer:+,addition
tick

addition

Correct Answer:-,subtraction
tick

subtraction

Correct Answer:*,multiplication
tick

multiplication

Correct Answer:/,real division
tick

real division

Correct Answer://,integer division
tick

integer division

Correct Answer:%,modulo division
tick

modulo division

Q5.
Match the expression with the result.
Correct Answer:10 + 5 * 2,20
tick

20

Correct Answer:30 // 7,4
tick

4

Correct Answer:18 % 4,2
tick

2

Correct Answer:9 / 3,3.0
tick

3.0

Q6.
/ performs real division and returns a decimal, while // performs division and discards the remainder.
Correct Answer: integer

6 Questions

Q1.
What do relational operators do in a program?
perform mathematical calculations
Correct answer: compare two values and return True or False
repeat a block of code multiple times
store user input
Q2.
What is the result of the expression
15 > 12
?
15
12
3
Correct answer: True
False
Q3.
The correct way to check if age is greater than 18 in Python is
if age ___ 18:
Correct Answer: >
Q4.
Match the operator to the operation.
Correct Answer:>,greater than
tick

greater than

Correct Answer:<,less than
tick

less than

Correct Answer:==,equal to
tick

equal to

Correct Answer:!=,not equal to
tick

not equal to

Correct Answer:>=,greater than or equal to.
tick

greater than or equal to.

Correct Answer:<=,less than or equal to
tick

less than or equal to

Q5.
Match the expression with its result.
Correct Answer:10 < 15,True
tick

True

Correct Answer:5 >= 10,False
tick

False

Q6.
What will be displayed if score = 11 in the following code?
123456
if score < 5: print("You lose") elif score <= 10: print("Not bad!") else: print("You win!")
You lose
Not bad!
Correct answer: You win!