← back to unit
Easy
# basics variables
Combining Conditions: and / or / not
Logical operators combine True/False values:
and—Trueonly if both sides areTrueor—Trueif at least one side isTruenot— flipsTruetoFalseand back
print(5 > 2 and 5 < 10)
print(5 > 2 and 5 > 10)
prints:
True
False
Your turn: read three numbers, a, b, c. Print the result of a > b and b > c.
💡 need a hint?
pyb-var-logical.py🔒 given lines are locked — write your code in between
loading...