🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.['a', 'bb', 'ccc']
  2. B.[1, 2, 3]
  3. C.6
  4. 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 →