python之函数用法round()
# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python之函数用法round()
#http://www.cnblogs.com/hongfei/p/3858256.html #round()
#说明:返回有N个小数点浮点数,
'''
round(...)
round(number[, ndigits]) -> floating point number Round a number to a given precision in decimal digits (default 0 digits).
This always returns a floating point number. Precision may be negative.
''' #案例
print round(3.1415926,3)#3.142
print round(3.1415926,2)#3.14
print round(3.1415926,10)#3.143.1415926
print round(100.000056, 3)#100.0
print round(-100.000056, 3)#-100.0
python之函数用法round()的更多相关文章
- Python回调函数用法实例
Python回调函数用法实例 作者:no.body链接:https://www.zhihu.com/question/19801131/answer/27459821 什么是回调函数? 我们绕点远路来 ...
- Python回调函数用法实例详解
本文实例讲述了Python回调函数用法.分享给大家供大家参考.具体分析如下: 一.百度百科上对回调函数的解释: 回调函数就是一个通过函数指针调用的函数.如果你把函数的指针(地址)作为参数传递给另一个函 ...
- python之函数用法setdefault()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法setdefault() #D.get(k,d) #说明:k在D中,则返回 D[K], ...
- python之函数用法fromkeys()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法fromkeys() #fromkeys() #说明:用于创建一个新字典,以序列seq ...
- python之函数用法get()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法get() #http://www.runoob.com/python/att-dic ...
- python之函数用法capitalize()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成 ...
- python之函数用法isupper()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isupper() #http://www.runoob.com/python/att ...
- python之函数用法islower()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法islower() #http://www.runoob.com/python/att ...
- python之函数用法startswith()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法startswith() #http://www.runoob.com/python/ ...
随机推荐
- 引子——从Mac OS X的Lion说起
最近感悟越来愈多,女儿越来越大,头发越来越少,我知道,自己老了. 30岁之后,时间仿佛开闸的河水一样滚滚而去,感觉自己浪费的时间太多.我们不得不承认,先知先觉的人会比我们领先10年甚至更多的身位.所以 ...
- 给.DLL文件加一个数字签名的方法
给.dll文件加一个数字签名的方法 效果如图所示: 做法: 下载数字签名工具包:http://files.cnblogs.com/babyt/SignTool.rar /Files/JavaC ...
- Xsolla和Crytek合作,对游戏战争前线推出全新支付方式
新闻稿: Sherman Oaks, 加州 (美国) –2014年 10月 15日-计费提供商Xsolla今日正式宣布.和著名游戏开发商以及发行商 Crytek.这次合作意味着玩家能够期待大量的游戏内 ...
- Tomcat与Gzip与缓存
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- CHM编写软件
工具选择 1. HTML编辑工具:就是用什么软件写文档的问题.一直都是做.NET开发,所以选择HTML编辑也大都在MS阵营里选.主要有以下几种HTML编辑器. (1) Dr ...
- spring service事务传播
spring定义的事务行为有以下几种: REQUIRED--支持当前事务,如果当前没有事务,就新建一个事务.这是最常见的选择. SUPPORTS--支持当前事务,如果当前没有事务,就以非事务方式执行. ...
- linux下通过iptables只允许指定ip地址访问指定端口的设置方法
这篇文章主要介绍了linux下通过iptables只允许指定ip地址访问指定端口的设置方法,需要的朋友可以参考下. 首先,清除所有预设置 iptables -F#清除预设表filter中的所有规则链的 ...
- mysql错误日志/var/log/mariadb/mariadb.log,二进制日志
mariadb-日志 IT_luo关注0人评论65人阅读2018-10-15 08:59:03 mariadb日志 mariadb日志: 1.查询日志:query log: 2.慢查询日志:slo ...
- 第十一章 自己实现一致性hash算法
关于一致性hash算法的意义以及其相对于简单求余法(除数求余法)的好处,查看第六章 memcached剖析 注意:真实的hash环的数据结构是二叉树,这里为了简便使用了列表List 1.一致性hash ...
- Largest Rectangle in Histogram leetcode java
题目: Given n non-negative integers representing the histogram's bar height where the width of each ba ...