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

1 Answers1

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