python中while循环语句
1、
>>> i = 1
>>> sum = 0
>>> while i <= 100:
sum = sum + i
i = i + 1 ## 当此处i等于101时循环停止
>>> print(sum)
5050
2、
>>> a = 100
>>> b = int(input("please input an num: "))
please input an num: 50
>>> while True:
if b == a:
break
b = int(input("please input an num again: "))
please input an num again: 60
please input an num again: 200
please input an num again: 550
please input an num again: 100
>>>