python除法取余、取整、取结果的小数位、保留小数

取整:7/3
取余:7%3
取结果小数位:

import math
math.modf(7/3)[0]

保留小数:round(7/3,2)

猜你喜欢

转载自blog.csdn.net/weixin_35757704/article/details/130802600