向下取整:int() , int(3.8)=3向上取整:ceil() , 使用是需要导入math模块 import math math.ceil(3.36) #4 math.ceil(3.2) #4 四舍五入: round() , round(4.4)=4,round(4.6)=5分别取整数及小数:math.modf(4.25)=(0.25,4)