# -*- 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()的更多相关文章

  1. Python回调函数用法实例

    Python回调函数用法实例 作者:no.body链接:https://www.zhihu.com/question/19801131/answer/27459821 什么是回调函数? 我们绕点远路来 ...

  2. Python回调函数用法实例详解

    本文实例讲述了Python回调函数用法.分享给大家供大家参考.具体分析如下: 一.百度百科上对回调函数的解释: 回调函数就是一个通过函数指针调用的函数.如果你把函数的指针(地址)作为参数传递给另一个函 ...

  3. python之函数用法setdefault()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法setdefault() #D.get(k,d) #说明:k在D中,则返回 D[K], ...

  4. python之函数用法fromkeys()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法fromkeys() #fromkeys() #说明:用于创建一个新字典,以序列seq ...

  5. python之函数用法get()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法get() #http://www.runoob.com/python/att-dic ...

  6. python之函数用法capitalize()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成 ...

  7. python之函数用法isupper()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isupper() #http://www.runoob.com/python/att ...

  8. python之函数用法islower()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法islower() #http://www.runoob.com/python/att ...

  9. python之函数用法startswith()

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法startswith() #http://www.runoob.com/python/ ...

随机推荐

  1. SQLite使用EF6的连接配置

    在配置文件中配置连接字符串 1. 使用nuget安装SQLite Install-Package System.Data.SQLite 安装好后的依赖项有: System.Data.SQLite.dl ...

  2. 【maven】排除maven中jar包依赖的解决过程 例子:spring cloud启动zipkin,报错maven依赖jar包冲突 Class path contains multiple SLF4J bindings.

    一直对于maven中解决jar包依赖问题的解决方法纠结不清: 下面这个例子可以说明一个很简单的解决方法: 项目启动报错: Connected to the target VM, address: '1 ...

  3. Unity3.x游戏开发经典教程 书例 100%完毕~

    大家都公布自己的作品,作为一个新人,我也发点什么.刚刚做完了Unity3.x游戏开发经典教程书例不久,假如有同学想学这本书入门U3D,我的作品也能让新人參考一下...脚本都是C#写的.以下附上链接~ ...

  4. OWIN and Katana

      OWIN(Open Web Interface for .NET)是在.net的web server和web应用之间定义了一套规范. Katana是微软实现了OWIN的一个Web Server的项 ...

  5. windows下androidNDK环境配置

    一:什么是NDK? NDK 提供了一系列的工具,帮助开发者快速开发C(或C++)的动态库,并能自动将so 和java 应用一起打包成apk.这些工具对开发者的帮助是巨大的. NDK 集成了交叉编译器, ...

  6. pytest文档18-配置文件pytest.ini

    前言 pytest配置文件可以改变pytest的运行方式,它是一个固定的文件pytest.ini文件,读取配置信息,按指定的方式去运行. ini配置文件 pytest里面有些文件是非test文件 py ...

  7. go omitempty 忽略类型

    nil false 0 每个结构字段的编码可以通过结构字段标签中“json”键下存储的格式字符串来定制.格式字符串给出字段的名称,可能后跟逗号分隔的选项列表.名称可能为空,以指定选项而不覆盖默认字段名 ...

  8. 在VirtualBox中为已有的磁盘增加磁盘大小

    ①打开CMD,进入到具体虚拟机镜像的存放位置. ②输入命令:VBoxManage modifyhd uuid --resize 25000,这里的25000单位是M,表示修改后的硬盘大小.若是VBox ...

  9. Tomcat 7 的七大新特性

    英文原文:Top 7 Features in Tomcat 7: The New and the Improved Tomcat的7引入了许多新功能,并对现有功能进行了增强.很多文章列出了Tomcat ...

  10. 图文详解 Android Binder跨进程通信机制 原理

    图文详解 Android Binder跨进程通信机制 原理 目录 目录 1. Binder到底是什么? 中文即 粘合剂,意思为粘合了两个不同的进程 网上有很多对Binder的定义,但都说不清楚:Bin ...