"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 TUTORIALS


PYTHON TUTORIALS » Buildin Function » Reduce »

 

"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


def add(x,y)return x+y

print reduce(add, range(111))



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Reduce