小白求解用while循环语句求和出错
python3吧
全部回复
仅看楼主
level 2
mrz曾先森
楼主
1+n<=100的求和
用while循环语句求和
按照老师交的这样的写法如图,
求和是得到5050
为什么我按照老师写法运行却是得到4950
i=1
s=0
while i<=100:
print(s)
s=s+i
i=i+1
小白求老炮求解
2021年10月03日 14点10分
1
level 7
FuturePython10
可以一起自学pythonl。自学qq群:962991806
2021年10月03日 23点10分
2
1