任务不是计算奇数和么,那么continue应该是判断 if x%2 !=0: 有同样的问题么
sum = 0
x = 1
while True:
x = x + 1
if x > 100:
break
if x%2 !=0:
continue
sum = sum + x
print sum
sum = 0
x = 1
while True:
x = x + 1
if x > 100:
break
if x%2 !=0:
continue
sum = sum + x
print sum
2015-06-05
举报