python计算sigma


from functools import reduce

def sigma(i,j):
    return reduce(lambda a, x: a + x, [0]+list(range(i,j+1)))
    

print(sigma(1,10000))


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *