python向上取整

相关推荐:《Python教程》

方法:

Python match.ceil函数

ceil(x)函数是向上取整,即取大于等于x的最接近整数。

import math

math.ceil(float(1)/2)

来源:PY学习网:原文地址:https://www.py.cn/article.html

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » python 如何向上取整