QuestionQ111

VerifiedControl Flow – Conditional Blocks and Loops

Which of the following for loops would produce the number pattern shown below?

Question Image

Explanation

range(1, 6) iterates over the integers 1 through 5. For each value, str(i) * 5 repeats its digit five times, producing 11111, 22222, 33333, 44444, and 55555 on separate lines.

Community Discussion

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