Relational/comparison operators

Cards (9)

  • Relational or comparison operators are used to compare the values within an expression, such as to check if the value held by a variable matches the value held by another variable. Most operators use mathematical notation.
  • The expressions in which relational operators are applied evaluate to either True or False. The pieces of data (e.g. values, variables, or other expressions) on which the program performs the operations are called operands.
  • == is the equality operator in Python.
  • > means greater than.
  • < means less than.
  • = is the assignment operator in Python.
  • != means not equal to.
  • >= is greater than or equal to.
  • <= is less than or equal to.