Python_Institute
PCEP-30-02 · Question #325
How many stars will the following snippet print to the monitor? data = [[x for x in range(y)] for y in range(3)] for d in data: if len(d) < 2: print('*')
The correct answer is C. two. See the full explanation below for the reasoning.
Question
How many stars will the following snippet print to the monitor?
data = [[x for x in range(y)] for y in range(3)]
for d in data:
if len(d) < 2:
print('*')
Options
- Athree
- Bzero
- Ctwo
- Done
How the community answered
(33 responses)- A6% (2)
- B3% (1)
- C76% (25)
- D15% (5)
Community Discussion
No community discussion yet for this question.