✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The boolean constants in Python are True
and False
, and the operators for combining boolean expressions are and
, or
, and not
. If <<expr1>>
and <<expr2>>
are two boolean expressions, then:
<<expr1>> and <<expr2>>
evaluates to true exactly when both <<expr1>>
and <<expr2>>
evaluate to true, and evaluates to false otherwise;<<expr1>> or <<expr2>>
evaluates to true when at least one of <<expr1>>
and <<expr2>>
evaluate to true, and evaluates to false otherwise; andnot <<expr1>>
evaluates to true exactly when <<expr1>>
evaluates to false, and vice-versa.What do you think the order of precedence is between and
, or
and not
? You can check the answers by extending your program in expressions.py
to print out the result of evaluating the following boolean expressions.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!