QUESTION IMAGE
Question
if you dont use parentheses to clarify how to evaluate a complex logical expression, what will happen when python tries to evaluate that expression?
select one:
o a. python will display a logicalexception error message
o b. python will use default internal rules to set the evaluation order
o c. python will always evaluate all operators from left to right in the same priority
o d. the results are random and impossible to predict
which operator would you use if you wanted the result to be true only if both log i expressions that you are joining together are true?
select one:
o a. not
o b. and
o c. or
o d. =
- In Python, the
andoperator returns True only if both operands (the expressions it joins) are True. For example, if we haveTrue and True, it will evaluate toTrue, but if we haveTrue and FalseorFalse and TrueorFalse and False, it will evaluate toFalse. - The
notoperator is a unary operator (works on a single value). It inverts the truth - value of a single expression. For example,not TrueisFalseandnot FalseisTrue. - The
oroperator returns True if at least one of the operands is True. - The
=is an assignment operator, not a logical operator for checking truth - values in the context of joining expressions for a combined truth - value.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
B. and