Python_Institute
PCEP-30-02 · Question #311
Consider the following code. ``python for n in range(1, 6, 1): print(??? * 5) ` What would you insert instead of ???, so that the program prints the following pattern to the monitor? ` 11111 22222…
The correct answer is C. str(n). See the full explanation below for the reasoning.
Question
Consider the following code.
for n in range(1, 6, 1):
print(??? * 5)
What would you insert instead of ???, so that the program prints the following pattern to the monitor?
11111
22222
33333
44444
55555
Options
- A-1
- Bn
- Cstr(n)
- D1
- E2
How the community answered
(28 responses)- A7% (2)
- B4% (1)
- C86% (24)
- E4% (1)
Community Discussion
No community discussion yet for this question.