← 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?
- A.['h', 'l', 'l']
- B.['e', 'o']
- C."hll"
- 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 →