>百科大全> 列表
怎么查找小数后2位
时间:2025-05-08 04:58:32
答案

可以使用round函数来将小数保留两位。例如:

a = 3.14159

b = round(a, 2)

print(b)

这将输出3.14,即保留小数点后两位。

推荐
© 2025 雅普电脑网