16
Given the following function f with two arguments, what is the standard way to apply map to only x?
def f (x,y):
print x,y
More specifically, I would like to perform the following operation with map in one line.
list=[1,2,3]
fixed=10
for s in list:
f(s,fixed)
One way to do so is:
import functools
map(functools.partial(lambda x,y:f(y,x),fixed),list)
What is a better way?