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 24 times
0

David
- 393
- 3
- 4
- 11
-
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))))

Wasif
- 14,755
- 3
- 14
- 34