#求100内奇数和while\for..in循环
sum = 0
i = 1
while i <= 100:
sum += i
i += 2
print(sum) sum = 0
for i in range(1,101,2):
sum += i
print(sum) #求100内偶数while\for..in循环
sum = 0
i = 0
while i <=100:
sum += i
i += 2
print(sum) sum = 0
#range函数end时不包括当前数值,所有注意101.
for i in range(0,101,2):
sum += i
print(sum)