reduce() in Python

Source code :

import functools
a=[2,45,67,54]
value=functools.reduce(lambda x,y: x+y,a)
print(value)

Output :

168

Output :


                

Comments :