任何人都可以给我一个完整的代码示例?如果我打印总数,为什么结果总数是21(即当前的总和)???
end=6
total = 0
current = 1
while current <= end:
total += current
current += 1
print total
Run Code Online (Sandbox Code Playgroud)
Tim*_*ker 11
因为1+2+3+4+5+6是21.为什么那么神秘?
| 归档时间: |
|
| 查看次数: |
95 次 |
| 最近记录: |