Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

if you dont use parentheses to clarify how to evaluate a complex logica…

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. =

Explanation:

Brief Explanations
  • In Python, the and operator returns True only if both operands (the expressions it joins) are True. For example, if we have True and True, it will evaluate to True, but if we have True and False or False and True or False and False, it will evaluate to False.
  • The not operator is a unary operator (works on a single value). It inverts the truth - value of a single expression. For example, not True is False and not False is True.
  • The or operator 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.

Answer:

B. and