← Quiz: Comprehensions and Lambda: all 15 questions
Quiz: Comprehensions and Lambda · Question 3 of 15
What does list(map(len, ["a", "bb", "ccc"])) return?
What does list(map(len, ["a", "bb", "ccc"])) return?
- A.['a', 'bb', 'ccc']
- B.[1, 2, 3]
- C.6
- D.[3]
Answer & explanation
Correct answer: [1, 2, 3]
map applies len to each string.
Can you get the rest right without peeking?
Take the timed Quiz: Comprehensions and Lambda quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →