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

Comparison operators

301.8 Boolean Expressions

Practise exam questions

Boolean Expressions — Note 1 of 3

== != < > <= >=

What you need to know

Comparison operators compare two values and return True or False. They are used in conditions for if statements, while loops, and other decision structures.

What to know

  • == equal to (not = which is assignment)
  • != not equal to
  • < less than, > greater than
  • <= less than or equal, >= greater than or equal
  • Result is always True or False (a bool)

Code examples

Comparison operators
python
age = 16
print(age == 16)   # True
print(age != 18)   # True
print(age >= 18)   # False
print(age < 21)    # True
← Previous topicTidy code comparison301.7 Maintainable CodeNext note →Logical operators301.8 Boolean Expressions

Back to Boolean Expressions

Specification notes for programming are in Paper 2.

Boolean Expressions

Note 1 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).