#encoding=utf-8
i = 1sum = 0while i <= 100:sum = sum + ii += 1
print("1~100的累积和为:%d" % sum)
i = 1sum = 0while i <= 100:if i % 2 == 0:sum = sum + ii+=1
while循环应用
原文:http://blog.51cto.com/13857166/2140628