40. while循环写法:
例如: while i<=10:print(i) i+=1
方法一,用for:
he = 0
for i in range(1,101):
he += i
print(he)
方法二,用while:
he = 0
i = 1
while i < 101:
he += i
i += 1
print(he)
i = 0
he = 0
while i<100:
i = i + 1
he = he + i
print(he)
print(i)
另一种写法