标签:sum start utf-8 之间 int art 代码 应用 +=
while循环应用#encoding=utf-8
i = 1
sum = 0
while i <= 100:
sum = sum + i
i += 1
print("1~100的累积和为:%d" % sum)
#encoding=utf-8
i = 1
sum = 0
while i <= 100:
if i % 2 == 0:
sum = sum + i
i+=1
print("1~100的累积和为:%d" % sum)
标签:sum start utf-8 之间 int art 代码 应用 +=
原文地址:http://blog.51cto.com/13857166/2140628