python向上取整 相关推荐:《Python教程》 方法: Python match.ceil函数 ceil(x)函数是向上取整,即取大于等于x的最接近整数。 import math math.ceil(float(1)/2)