Question 60 of 97
Q.Consider the given expression: 5<10 and 12>7 or not 7>4 Which of the following will be the correct output, if the given expression is evaluated?
(a) True
(b) False
(c) NONE
(d) NULL
Karnataka PUCCBSE Class XII Board 2023MCQ· 1mImportance★★★★★
62% · 60/97 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →5<10 and 12>7 or not 7>4 groups as ((5<10) and (12>7)) or (not (7>4)) = True or False = True. Correct option: (a) True.
Concept — logical-operator precedence in Python
Among Python's logical operators the precedence order is: not (highest) → and → or (lowest), and all comparison operators (<, >) bind tighter than any of them. So the expression is implicitly bracketed as:
((5 < 10) and (12 > 7)) or (not (7 > 4))
Step-by-step trace
| Step | Evaluates | Result | Expression so far |
|---|---|---|---|
| 1 | 5 < 10 | True | True and 12>7 or not 7>4 |
| 2 | 12 > 7 | True | True and True or not 7>4 |
| 3 | 7 > 4 | True | True and True or not True |
| 4 | not True (not first) | False | True and True or False |
| 5 | True and True (and next) | True | True or False |
| 6 | True or False (or last) | True | True |
Run it:
print(5<10 and 12>7 or not 7>4)
Output:
True
(Short-circuit view: the left side of the or is already True, so the whole expression is True no matter what not 7>4 gives.)
Why the other options are wrong …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.