Boolean Operators

Computer Science: KS3, topic 2.1.6

Boolean Operators

Boolean operators perform logical operations and always result in True or False values. An operand is a variable that the operator acts on.

AND

AND

  • AND evaluates to True if and only if both operands are True.
  • True AND True = True.
  • True AND False = False.
  • False AND True = False.
  • False AND False = False.
OR

OR

  • OR evaluates to True if any of the two operands are True:
  • True OR True = True.
  • True OR False = True.
  • False OR True = True.
  • False OR False = False.
NOT

NOT

  • NOT negates a logical value.
  • NOT True = False.
  • NOT False = True.

Test yourself on Boolean Operators

  • Which Boolean operator takes only one value as input?

  • What does the following expression in Python return?

    False or True

Practise this topic for free