import time i = 0 num = 0 while i<= 100: num+=i i+=1 print('%d' %num) 转载于:https://www.cnblogs.com/20190308-zlz/p/zlz-whileNum.html