python code with sigma

39

#creating a sigma function
a=int(input("enter a number for sigma  "))
mylst=[]

for i in range(1,a+1):
     mylst.append(i)
     b=sum(mylst)
print(mylst)
print(b)

Comments

Submit
0 Comments