sum = 0
i = 1
wile i<=100:
if i % 2 == 0:
sum = sum + i
i = i + 1
print("1~100之间偶数的和为:%d"%sum)
sum = 0
i = 1
wile i<=100:
if i % 2 == 0:
sum = sum + i
i = i + 1
print("1~100之间偶数的和为:%d"%sum)
本文标题:Python3练习三:求1~100之间偶数的和
本文链接:https://www.haomeiwen.com/subject/luvuhftx.html
网友评论