Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Boolean Expressions

Logical operators

301.8 Boolean Expressions

Practise exam questions

Boolean Expressions — Note 2 of 3

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.

What to know

  • 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")
← Previous noteComparison operators301.8 Boolean ExpressionsNext note →Translate logic301.8 Boolean Expressions

Back to Boolean Expressions

Specification notes for programming are in Paper 2.

Boolean Expressions

Note 2 of 3

  1. 1Comparison operators
  2. 2Logical operators
  3. 3Translate logic
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).