QuestionQ92Verified/Control Flow – Conditional Blocks and LoopsCopy linkReport a problemAsk AstroTutorSave questionHow many stars does the following snippet print to the monitor? AthreeBzeroCtwoDoneShow AnswerAnswerExplanationThe nested list comprehension produces sublists of lengths 0, 1, and 2. The condition len(d) < 2 is true for the first two sublists only, so print('*') executes twice.Learn morePython Tutorial: List ComprehensionsPython Built-in Functions: lenShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion