Page 146 - Beginning Programming with Pyth - John Paul Mueller
P. 146
>=
<=
Logical
Verifies that the left operand value is greater than or equal to the right operand value.
Verifies that the left operand value is less than or equal to the right operand value.
1 >= 2 is False
1 <= 2 is True
The logical operators combine the true or false value of variables or expressions so that you can determine their resultant truth value. You use the logical operators to create Boolean expressions that help determine whether to perform tasks. Table 7-4 describes the logical operators.
TABLE 7-4 Python Logical Operators
Operator
and
Description Example
or
Determines when one of two operands is true.
Determines whether both operands are true.
True and True is True
True and False is False
False and True is False
False and False is False
True or True is True
True or False is True
False or True is True
False or False is False