Logical operators AND, OR and NOT
AND is TRUE only when both conditions are TRUE. OR is TRUE when at least one is TRUE. NOT reverses a BOOLEAN value. Use brackets to make complex conditions clear.
Understanding Logical operators AND, OR and NOT in IGCSE Computer Science Paper 2
What it does: An Answer cannot be below 0 and above 100 at once, so OR is used. Either test being TRUE makes the whole condition TRUE. The brackets group the AND test together before OR is applied, so the order of checking is clear. NOT reverses a BOOLEAN value. NOT TRUE is FALSE. NOT GameOver is TRUE while GameOver is FALSE. So the loop keeps running until GameOver becomes TRUE. AND needs both conditions to be TRUE. One of them is FALSE, so the result is FALSE. OR is TRUE when at least one condition is TRUE. The first one is TRUE, so the result is TRUE.
Common mistakes: OR is TRUE when at least one condition is TRUE, so every number passes (for example 150 is >= 0). A range check needs AND so that both conditions must be TRUE: IF Mark >= 0 AND Mark <= 100. Mark > 0 leaves out 0, which is a valid mark. The first part must be Mark >= 0 so that both 0 and 100 are accepted: Ok ← Mark >= 0 AND Mark <= 100.
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 156–165) and word search (Modules 146–165).
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 →