Exam-style question
Try this first
In Python, what is printed by this code?\n\nx = 4\ny = 7\nif x > 5 or y < 3:\n print("yes")\nelse:\n print("no").
- A.yes
- B.no
- C.4
- D.7
Answer and explanation
Concise answer
no
Why this is correct
x > 5 is false and y < 3 is false. The OR condition is therefore false, so the else branch runs.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
