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
Model answer
What a good answer should say
- no
Explanation
Why this works
x > 5 is false and y < 3 is false. The OR condition is therefore false, so the else branch runs.
Common mistake
No common mistake is linked to this question yet.
