Vidyalelo
Python · Q64

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 64

Q64

What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?

A.
[1|x for x in [1, 2, 3]]
B.
[-1**x for x in [1, 2, 3]]
C.
[x**-1 for x in [1, 2, 3]]
Answer
D.
[x^-1 for x in range(4)]

Answer: Option C

Solution

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