QuestionQ139

VerifiedControl Flow – Conditional Blocks and Loops

Consider this code.

Question Image

What should replace ??? so that the program prints this pattern on the monitor?

Question Image

Explanation

str(n) converts each loop value to text, and multiplying that string by 5 repeats it five times. The iterations therefore print 11111, 22222, 33333, 44444, and 55555.

Community Discussion

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