icon-background-square
New
New
Year 10
AQA

Logical operators

I can use logical operators to build more complex selection statements.

icon-background-square
New
New
Year 10
AQA

Logical operators

I can use logical operators to build more complex 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. Logical operators are often used when you need to evaluate multiple relational expressions to return a single value.
  2. Logical expressions return as either True or False. The three basic logical operators are and, or, and not.
  3. Logical expressions can be used in selection statements.

Keywords

  • Logical expression - an expression that combines relational and logical operators

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

Common misconception

A logical expression can only check one value.

Logical expressions can combine relational and logical operators to check multiple values or inputs.


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

Comparing values of objects is a useful way to visualise the use of realtional operators. Props in the classroom help make these comparisons more concrete.
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.
A compares two values and produces the result of True or False.
Correct Answer: relational operator
Q2.
Match the arithmetic operator to the symbol:
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
tick

less than

Q3.
Write the if statement command to check if the value stored in the variable called num is 10 or more.
Correct Answer: if num >= 10:, if num>=10:
Q4.
What will be displayed if score is 5?
123456
if score < 5: print ("You lose") elif score <= 10: print ("Not bad!") else: print ("You win")
You lose
Correct answer: Not bad!
You win
Q5.
What will be displayed if score is 10?
123456
if score < 5: print ("You lose") elif score <= 10: print ("Not bad!") else: print ("You win")
You lose
Correct answer: Not bad!
You win
Q6.
What will be displayed if score is 11?
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

6 Questions

Q1.
What is the purpose of logical operators in programming?
To perform mathematical calculations.
To repeat a block of code multiple times.
Correct answer: To compare multiple conditions and return True or False.
To store user input.
Q2.
Which of the following is True when both conditions are True?
or
Correct answer: and
not
Q3.
The expression `(5 > 3) and (10 < 20)` evaluates to .
Correct Answer: True
Q4.
Which logical operator is used to reverse the result of a condition?
and
or
Correct answer: not
Q5.
The expression `(8 < 3) and (5 > 2)` evaluates to .
Correct Answer: False
Q6.
What will be displayed if the user inputs "king" for value and "hearts" for suit?
123456
if value == "king" and suit == "hearts": print("Match") else: print("Not a match")
Correct answer: Match
Not a match
Error