🎙 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 2 of 15

What does [c for c in "hello" if c not in "aeiou"] give?

What does [c for c in "hello" if c not in "aeiou"] give?

  1. A.['h', 'l', 'l']
  2. B.['e', 'o']
  3. C."hll"
  4. D.['h', 'e', 'l', 'l', 'o']
Answer & explanation

Correct answer: ['h', 'l', 'l']

It keeps characters that are not vowels, as a list.

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 →