python内置函数

1、reduce() 函数会对参数序列中元素进行累积。

reduce() 函数语法:

reduce(function, iterable[, initializer])

例:

from functools import reduce
s = reduce(lambda x,y:x+y,range(1,10))
print(s) #45
原文地址:https://www.cnblogs.com/venvive/p/12640114.html