"reduce(func, sequence)" returns a single value by calling the function func on the first two items of the sequence, then on the result and the next item, and so on : reduce « Buildin Function « Python Tutorial






def add(x,y): return x+y

print reduce(add, range(1, 11))
13.40.reduce
13.40.1."reduce(func, sequence)" returns a single value by calling the function func on the first two items of the sequence, then on the result and the next item, and so on
13.40.2.reduce and lambda