logo

Question detail

For each relational operator below, state what it tests and give one Python 3 example: ==, !=, <, >, <= and >=.

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

Question

Type

practice

Style

Topic

Programming

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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.