QuestionQ21

VerifiedControl Flow – Conditional Blocks and Loops

What output is expected from the following code?

Question Image

Explanation

Python evaluates and before or. The first two conditions evaluate to False, while the third evaluates to True because not y and x is True; therefore, the code prints 3.

Community Discussion

No comments yet. Be the first to start the discussion!