运用循环求和( sum operation in python)
1.for loop
example 1: sum of 1+2+...+10
**********
>>> sum=0
>>> for x in [1,2,3,4,5,6,7,8,9,10]:
sum=sum+x
>>> print(sum)
**********
example 2: sum of 1+2+...+100
**********
sum=0
for x in range (101):
sum=sum+x
print(sum)
********