"""Boolean values and expressions""" # a Boolean variable has one of two values: True or False type(True) # when we assign a Boolean value to a variable it becomes # a Boolean variable a = False type(a) # A boolean expression is an expression that evaluates to a boolean value. # The operator == compares two values and produces a boolean value: 5 == 5 5 == 6 # don't confuse the comparison operator == with the assignment operator = # other comparison operators x = 1 y = 2 x != y # x is not equal to y x > y # x is greater than y x < y # x is less than y x >= y # x is greater than or equal to y x <= y # x is less than or equal to y # logical operators: and, or, not x = 2 x > 0 and x < 10 # True if x is greater than 0 and less than 10 x % 2 == 0 or x % 3 == 0 # True if either of the conditions is true, that is, # if the number is divisible by 2 or 3 # not is the negation operator: not(True) not(False) x = 1 y = 2 not(x > y)