print(math.floor(2.34)) #2
print(math.ceil(2.34)) #3
print(round(2.34)) #2
print(round(2.54)) #3
本文通过具体示例展示了Python中math库的floor、ceil和round函数的使用方法,这些函数分别用于向下取整、向上取整和四舍五入。
print(math.floor(2.34)) #2
print(math.ceil(2.34)) #3
print(round(2.34)) #2
print(round(2.54)) #3
6994
3511

被折叠的 条评论
为什么被折叠?