Logical operators AND, OR, NOT
Logical operators that combine BOOLEAN conditions: AND needs both true, OR needs at least one true, NOT reverses a condition. Use brackets in complex ones, e.g. Age >= 0 AND Age <= 120.
Understanding Logical operators AND, OR, NOT in IGCSE Computer Science Paper 2
What it does: An answer is invalid if it is below 0 or above 100. OR only needs one of the two conditions to be true. The brackets make the OR happen first. Then the AND checks that the person is also a member. Both parts must be true for a valid age, so AND is needed. With OR, almost any number (e.g. 500 or -5) would pass. OR needs at least one true condition. Needing both true describes AND. Each side of AND must be a complete condition, so Age must be repeated on both sides. NOT reverses the result of the condition in the brackets, so it is true whenever Score is not 50.
Common mistakes: With OR, only one part has to be true, so every number passes (for example -5 is <= 120). A valid age must be >= 0 AND <= 120, so both parts must be true. No number can be below 0 and above 100 at the same time, so AND is never true and bad answers are never caught. It should be OR, because only one part needs to be true.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 27–36) and word search (Modules 27–46).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
AND OR NOTFill in the Blanks
Spot the Error
Student with a class code? Join your class →