Game Preview

Logic operators

  •  English    5     Public
    programming
  •   Study   Slideshow
  • What will the output of the following code be? x = 5; y = 10; print(x > 5 and y < 15)
    True
  •  15
  • If a = True and b = False, what is the result of a or b?
    True
  •  15
  • Which logical operator is used to reverse the boolean value of an expression?
    not
  •  15
  • What will be the output of this code? z = 20; print(not z < 10)
    True
  •  15
  • If x = 10 and y = 10, what will be the result of x == 10 and y != 5?
    True
  •  15