Getting Started With Python's and Operator
This table, called a truth table, shows the behavior of the
and operator. Basically, if both operands evaluate to
True, then the
and of those expressions is
True. In all other cases, the result of the
and operation is
False. So if you’re taking the
and of two expressions,
exp2, if both are
and of them is
It’s essentially the first expression, no matter what the second expression is. And in the second two rows, where the first expression is
True, then the result of the
and operation is whatever the expression two is.
Become a Member to join the conversation.