python map()函数

list_x = [1,2,3,4,5]
r=map(lambda x:x*x,list_x)
print(list(r))

list_x = [1,2,3,4,5]
list_y = [1,2,3,4,5]
r=map(lambda x,y:x*x+y,list_x,list_y)

print(list(r))

结果 个数 取决于 较小的 list个数

原文地址:https://www.cnblogs.com/angdh/p/11722726.html