📜  python reduce() - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:12.508000             🧑  作者: Mango

代码示例2
from functools import reduce
items = [1,2,3,4,5]
sum_all = reduce(lambda x,y: x + y, items)
 
print (sum_all) #15