Relational operators: = and <>
= tests whether two values are equal and <> tests whether they are not equal. Each gives TRUE or FALSE. Assignment uses <- instead, not =.
Understanding Relational operators: = and <> in IGCSE Computer Science Paper 2
What it does: Assignment uses the arrow <- to store 5 in Answer, whereas = would only test for equality. = compares two values in a condition, and text values are written in double quotes. The result is TRUE or FALSE, which IF uses to decide. <> means 'is not equal to'. "Alex" is not the same as "Sam", so the test gives TRUE. Answer is equal to 5, so 'not equal to 5' is FALSE. Cambridge pseudocode writes not equal as <>. The != symbol is used in languages such as Python and JavaScript. In a condition, = only compares. It never changes the value of Score. To change Score you would use Score <- 10.
Common mistakes: <- is assignment, not a test. A condition must use = to compare Answer with 5. It should be IF Answer = 5 THEN. Cambridge pseudocode uses <> for 'not equal to', not !=. It should be IF Name <> "Sam" THEN.
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 358–368) and word search (Modules 358–378).
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 <>Fill in the Blanks
Spot the Error
Student with a class code? Join your class →