give the output of is Print (10> 15 or 20)
Answers
Answered by
2
Answer:
The relevant rules governing “and” and “or” are this:
If the first operand of an “or” expression is true, return the first operand. Otherwise, evaluate and return the second operand.
If the first operand of an “and” expression is false, return the first operand. Otherwise, evaluate and return the second operand.
Furthermore, any value is interpreted as “false” for the above purposes if it is 0, 0.0, None, False, or an empty collection. Otherwise, it is interpreted as “true” for the above purposes. So, 10 and 20, being nonzero numbers, are “true.”
Therefore “print (10 or 20)” produces “10”.
And “print (10 and 20)” produces “20”.
Explanation:
Similar questions