1、for 循环
>>> sum = 0
>>> for i in range(101):
sum += i
>>> print(sum)
5050
2、while循环
>>> sum = 0
>>> i = 0
>>> while i <= 100:
sum += i
i += 1
>>> print(sum)
5050
1、for 循环
>>> sum = 0
>>> for i in range(101):
sum += i
>>> print(sum)
5050
2、while循环
>>> sum = 0
>>> i = 0
>>> while i <= 100:
sum += i
i += 1
>>> print(sum)
5050