Sea*_*aus 3 python rounding python-3.x
我想在这里使用圆函数.有时它会从.5有时向上舍入.所以有什么问题?
源文件:
print("rounding up 0.5 is",round(.5))
print("rounding up 1.5 is",round(1.5))
print("rounding up 2.5 is",round(2.5))
print("rounding up 3.5 is",round(3.5))
Run Code Online (Sandbox Code Playgroud)
输出:
rounding up 0.5 is 0
rounding up 1.5 is 2
rounding up 2.5 is 2
rounding up 3.5 is 4
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
428 次 |
| 最近记录: |