1. 向上取整
import math
f = 11.2
print math.ceil(f) #向上取整
out:12.0 # 返回结果是浮点型
2.向下取整
import math
f = 11.2
print math.floor(f) #向下取整
out: 11.0 #返回结果是浮点型
3. 四舍五入
import math
f = 11.2
print round(f) #四舍五入
out: 11.0 #返回结果是浮点型
4.参考
https://www.cnblogs.com/SZxiaochun/p/6961370.html