Exam-style question
Try this first
For each relational operator below, state what it tests and give one Python 3 example: ==, !=, <, >, <= and >=.
Model answer
What a good answer should say
- == tests equal to, for example 5 == 5.
- != tests not equal to, for example 5 != 7.
- < tests less than, for example 3 < 8.
- > tests greater than, for example 9 > 2.
Explanation
Why this works
Each operator compares two values and produces a Boolean result. The examples show the correct meaning and Python 3 spelling of all six required relational operations.
Common mistake
No common mistake is linked to this question yet.
