参考示例
def test(x):
return x * 2
mylist = [1, 2, 3, 4, 5]
result = list(map(test, mylist))
print(result)
运行结果如下所示:
[2, 4, 6, 8, 10]
参考链接
https://www.programiz.com/python-programming/methods/built-in/map
标签:map,mylist,函数,参考,python,result,test
来源: https://www.cnblogs.com/leoych/p/16182310.html