会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小小程序员ol
博客园
首页
新随笔
联系
订阅
管理
2020年12月16日
python中取整数的几种方法
摘要: 1、向下取整: int() >>> a = 14.38 >>> int(a) 14 2、向上取整:ceil() 使用ceil()方法时需要导入math模块,例如 >>> import math >>> math.ceil(3.33) 4 >>> math.ceil(3.88) 4 3、四舍五入:ro
阅读全文
posted @ 2020-12-16 19:25 小小程序员ol
阅读(2418)
评论(0)
推荐(0)
公告