round函数是什么意思怎么引用? 世界视讯

来源:互联网       时间:2023-03-31 14:00:19


(相关资料图)

1、描述round() 方法返回浮点数x的四舍五入值。

2、语法以下是 round() 方法的语法:round( x [, n] )参数x -- 数值表达式。

3、n -- 数值表达式。

4、返回值返回浮点数x的四舍五入值。

5、实例以下展示了使用 round() 方法的实例:#!/usr/bin/pythonprint "round(80.23456, 2) : ", round(80.23456, 2)print "round(100.000056, 3) : ", round(100.000056, 3)print "round(-100.000056, 3) : ", round(-100.000056, 3)以上实例运行后输出结果为:round(80.23456, 2) : 80.23round(100.000056, 3) : 100.0round(-100.000056, 3) : -100.0。

本文到此分享完毕,希望对大家有所帮助。

关键词:

上一篇:加强管理员队伍建设 提升技术保障能力 焦点报道
下一篇:最后一页