Python_Institute
PCEP-30-02 · Question #309
How many stars will the following snippet print to the monitor? ``python i = 0 while i <= 5: i += 1 if i % 2 == 0: break print('*') ``
The correct answer is C. one. See the full explanation below for the reasoning.
Question
How many stars will the following snippet print to the monitor?
i = 0
while i <= 5:
i += 1
if i % 2 == 0:
break
print('*')
Options
- Athree
- Bzero
- Cone
- Dtwo
How the community answered
(40 responses)- A8% (3)
- B5% (2)
- C85% (34)
- D3% (1)
Community Discussion
No community discussion yet for this question.