Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Boolean Expressions

Logical operators

All topicsPractise exam questions
Knowledge organiser

Boolean Expressions

301.8b

Use AND OR NOT.

What you need to know

Logical operators combine Boolean expressions. and requires both to be True, or requires at least one, and not flips True to False or vice versa.

Key points

  • and: both must be True → True and True = True
  • or: at least one True → False or True = True
  • not: reverses the value → not True = False
  • Use parentheses to group complex conditions

Code examples

Logical operators
python
age = 16
has_id = True

if age >= 18 and has_id:
    print("Entry allowed")
if age < 13 or age > 65:
    print("Discount applies")
if not has_id:
    print("ID required")