logo

Question detail

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")

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Abstraction and automation

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").

  1. A.yes
  2. B.no
  3. C.4
  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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.