QuestionQ167

VerifiedControl Flow – Conditional Blocks and Loops

What output should the following code produce?

Question Image

Explanation

counter has the value 42. Because counter > 0 is true, the first conditional branch runs and prints a single *; subsequent elif and else branches are not evaluated.

Community Discussion

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