1、python语言使用不同方法实现列表元素求和(https://jingyan.baidu.com/article/624e74599f68df75e8ba5ab3.html)
from functools import reduce
l = list(range(1,10))
print(reduce(lambda a,b:a+b, l))
2、
1、python语言使用不同方法实现列表元素求和(https://jingyan.baidu.com/article/624e74599f68df75e8ba5ab3.html)
from functools import reduce
l = list(range(1,10))
print(reduce(lambda a,b:a+b, l))
2、
本文标题:lambda
本文链接:https://www.haomeiwen.com/subject/nproprtx.html
网友评论