While循环求1-100的和 #求1-100的和 sum=0 i=1 while i<=100: sum+=i #sum=sum+i i+=1 #i=i+1 print(f"1-100累加的和是:{sum}") 运行结果