python map函数下参数func怎样才能传入2个参数进去

2024-12-29 09:54:24
推荐回答(1个)
回答1:

def mul(x):
return x*x
def my_map(func, args):
for n in args: print(func(n)) my_map(mul, [1,2,3,4])