Back to Boolean Operations In A Programming Language

Oak National Academy

Lessons written by expert teachers in England, each with slides, a video and quizzes.

Their topic:
Computer systems and data science · Boolean logic
For your topic:
Boolean Operations In A Programming Language · Computer Science - 9210

Use these lessons alongside our lesson note, which covers your syllabus in full.

What this covers in your syllabus

2 lessons from Oak National Academy

Lesson 1 of 2 · Lower secondary, ages 11 to 14

Boolean logic

By the end: I can describe how computers use Boolean logic and logic gates to make decisions.

Key learning points

  1. Computers make decisions using Boolean logic rules like AND, OR and NOT.
  2. Logic gates are electronic versions of logic rules that can be combined to control what a computer does.
  3. All computer hardware is built from logic circuits that understand only binary (0s and 1s).

Keywords

Boolean
an expression that evaluates to either True or False
logic gate
an electronic component that carries out a logical operation
truth table
a table showing the outputs for all possible combinations of inputs to a logic gate or logic circuit

A common mistake

Mistake: Boolean logic is about numbers

In fact: Boolean logic is about truth values such as yes/no, true/false or (1/0).

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

What do computers use Boolean logic for?
Which statement about Boolean logic is incorrect?

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

Lesson 2 of 2 · GCSE level, ages 14 to 16

Implementing Boolean logic in Python

By the end: I can use Boolean logic in a Python program.

Key learning points

  1. Boolean expressions give results that can be used in selection and iteration.
  2. Boolean logic is used in selection to test conditions.
  3. Complex decisions can be constructed with Boolean expressions.

Keywords

Boolean operator
an operator used in a Boolean expression, for example AND, OR and NOT
logical operator
another name for a Boolean operator
program flow
the order in which the instructions in a program are executed

A common mistake

Mistake: Boolean logic is only used in logic circuits and logic gates.

In fact: The three fundamental Boolean operators are AND, OR and NOT. These are used in programs to perform selection and control program flow. In Python, these are written in words as: and, or, not.

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

Which of the following are arithmetic operators in Python?
What does a comparison operator evaluate to?
In a Python program, what is used to make a decision about the program flow?
What type of operator is >=?

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

The wording comes from each publisher. The layout and the links to your syllabus are ours.