Vidyalelo
Python · Q55

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 55

Q55

Read the information given below carefully and write a list comprehension such that the output is: ['e', 'o'] w="hello" v=('a', 'e', 'i', 'o', 'u')

A.
[x for w in v if x in v]
B.
[x for x in w if x in v]
Answer
C.
[x for x in v if w in v]
D.
[x for v in w for x in w]

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board