1、1. 导入包 math
2. 函数 ceil 为向上取整 floor 为向下取整
通过 math.ceil() 来调用函数,看下图

2、math包还有很多其他数学函数,具体看文档 https://docs.python.org/zh-cn/3/library/math.html?highlight=math#module-math
1、1. 导入包 math
2. 函数 ceil 为向上取整 floor 为向下取整
通过 math.ceil() 来调用函数,看下图

2、math包还有很多其他数学函数,具体看文档 https://docs.python.org/zh-cn/3/library/math.html?highlight=math#module-math