Python3 round() 函数
Python 3 教程
· 2019-02-05 14:44:20
描述
round() 方法返回浮点数x的四舍五入值。
语法
以下是 round() 方法的语法:
round( x [, n] )
参数
- x -- 数字表达式。
- n -- 表示从小数点位数,其中 x 需要四舍五入,默认值为 0。
返回值
返回浮点数x的四舍五入值。实例
以下展示了使用 round() 方法的实例:
#!/usr/bin/python3
print ("round(70.23456) : ", round(70.23456))
print ("round(56.659,1) : ", round(56.659,1))
print ("round(80.264, 2) : ", round(80.264, 2))
print ("round(100.000056, 3) : ", round(100.000056, 3))
print ("round(-100.000056, 3) : ", round(-100.000056, 3))
以上实例运行后输出结果为:
round(70.23456) : 70 round(56.659,1) : 56.7 round(80.264, 2) : 80.26 round(100.000056, 3) : 100.0 round(-100.000056, 3) : -100.0
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
用户至上:用户研究方法与实践(原书第2版)
凯茜·巴克斯特 / 王兰、杨雪、苏寅 / 机械工业出版社 / 2017-5-1 / 99
《UI/UE系列丛书 用户至上:用户研究方法与实践(原书第2版)》是用户研究方法指南,谷歌用户体验研究员十几年工作经验结晶,从理论到实战,包含完整的实操案例,是设计以人为中心产品的实用手册。 《UI/UE系列丛书 用户至上:用户研究方法与实践(原书第2版)》包含五个部分共15章。入门篇包括第1~5章:介绍用户体验入门,如何理解目标用户,道德与法律问题,如何搭建研究设施,如何选择用户体验研究方......一起来看看 《用户至上:用户研究方法与实践(原书第2版)》 这本书的介绍吧!