QuestionQ83

VerifiedControl Flow – Conditional Blocks and Loops

How many stars does the following snippet display on the monitor?

Question Image

Explanation

range(1) causes the loop body to execute once, printing one star. Because the loop completes normally, its else block also executes and prints one additional star, for a total of two.

Community Discussion

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