πŸ“Š Python
Q. Read the information given below carefully and write a list comprehension such that the output is: [‘e’, ‘o’]
Code:
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]
  • (C) [x for x in v if w in v]
  • (D) [x for v in w for x in w]
πŸ’¬ Discuss
βœ… Correct Answer: (B) [x for x in w if x in v]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
205
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Tanmay
Publisher
πŸ“ˆ
86%
Success Rate