>>> import math
>>> math.floor(32.9)
32
>>> math.ceil(32.3)
33
>>> math.ceil(32)
32
>>>
>>> from math import sqrt
>>> sqrt(9)
3.0
>>>
使用python的数学函数
最新推荐文章于 2024-03-29 16:45:33 发布
本文深入探讨了Python中math模块的使用方法,包括向下取整、向上取整和平方根等核心函数的应用实例,为读者提供了理解和掌握Python数学运算的基础。
601

被折叠的 条评论
为什么被折叠?



