import functools
def add(x,y):
    return x+y
num_list = [1,2,3,4,5]
print("sum of values in list = ")
print(functools.reduce(add,num_list))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: