Suppose I have the list my_list = list(range(10))
. In using map()
, what is the equivalence of [K(x, fix_elem) for x in my_list]
? At the beginning, I thought map(K, my_list)
was fine, but I have a fixed element fix_elem
which is incompatible with my demand.
Asked
Active
Viewed 19 times
0
![](../../users/profiles/14335678.webp)
David
- 193
- 1
- 1
- 8
-
1`list(map(lambda x: K(x, fix_elem), my_list))` – mkrieger1 Oct 25 '20 at 00:34
1 Answers
0
You need to use map and lambda: list(map(lambda x: K(x, fix_elem), list(range(10))))
![](../../users/profiles/12269857.webp)
programmer365
- 12,641
- 3
- 7
- 28