0

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.

David
  • 193
  • 1
  • 1
  • 8

1 Answers1

0

You need to use map and lambda: list(map(lambda x: K(x, fix_elem), list(range(10))))

programmer365
  • 12,641
  • 3
  • 7
  • 28