Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can use relational operators as part of selection statements.

      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.

      Teacher tip

      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.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      Licence

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

      Lesson video

      Loading...

      Prior knowledge starter quiz

      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

      addition

      Correct Answer:-,subtraction

      subtraction

      Correct Answer:*,multiplication

      multiplication

      Correct Answer:/,real division

      real division

      Correct Answer://,integer division

      integer division

      Correct Answer:%,modulo division

      modulo division

      Q5.
      Match the expression with the result.

      Correct Answer:10 + 5 * 2,20

      20

      Correct Answer:30 // 7,4

      4

      Correct Answer:18 % 4,2

      2

      Correct Answer:9 / 3,3.0

      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

      greater than

      Correct Answer:<,less than

      less than

      Correct Answer:==,equal to

      equal to

      Correct Answer:!=,not equal to

      not equal to

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

      greater than or equal to.

      Correct Answer:<=,less than or equal to

      less than or equal to

      Q5.
      Match the expression with its result.

      Correct Answer:10 < 15,True

      True

      Correct Answer:5 >= 10,False

      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!")
      Code colour

      You lose
      Not bad!
      Correct answer: You win!

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