function with many args
map函数,采用偏函数方式来为函数来添加多个参数
map(functools.partial(self.english_recursive, branches=branches, index=index), next_level_knowledge_tags)
input a list of function!
话不多说,上代码
def multiply(x):
return (x*x)
def add(x):
return (x+x)
funcs = [multiply, add]
for i in xrange(5):
value = list(map(lambda x: x(i), funcs))
print(value)