Python教程 round()函数的使用

2024-10-31 23:10:30

1、新建一个round()函数的使用.py,如图所示:

Python教程 round()函数的使用

3、round() 函数的作用:获取浮点数的四舍五入值,语法结构如图所示:

Python教程 round()函数的使用

5、使用 round() 函数对 x 做四舍五入运算,代码:x = round(x)

Python教程 round()函数的使用
猜你喜欢