QuestionQ208

VerifiedControl Flow – Conditional Blocks and Loops

How many stars does the following code snippet print to the monitor?

Question Image

Explanation

The first loop iteration increments i to 1, so print('*') executes once. The next iteration increments i to 2, and break exits the loop before another star can be printed.

Community Discussion

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