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]]
d) [x^-1 for x in range(4)]
What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!