Informatics Practices

What is the result of this statement:

10>5 and 7>12 or not 18>3
  1. 10
  2. True
  3. False
  4. None

Python Funda

1 Like

Answer

False

Reason — The expression evaluates as follows: 10 > 5 is True because 10 is greater than 5. 7 > 12 is False because 7 is not greater than 12. 18 > 3 is True because 18 is greater than 3, and not True results in False. Combining these using Python's operator precedence, 10 > 5 and 7 > 12 evaluates to False (True and False). Then, False or not True evaluates to False (False or False). Therefore, the entire expression 10 > 5 and 7 > 12 or not 18 > 3 ultimately evaluates to False.

Answered By

2 Likes


Related Questions