python math常用模块

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/12/13 01:12
# @Author  : flyx
# @Site    : 
# @File    : demo3.py
# @Software: PyCharm

import math # 关于数学运算
print(id(math))
print(type(math))

print(math.pi)
print(dir(math))

print(math.pow(2,3),type(math.pow(2,3))) # 2的三次方

print(math.ceil(9.01)) # 向上取整

print(math.floor(9.99))#向下取整
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/12/13 01:12
# @Author  : flyx
# @Site    : 
# @File    : demo3.py
# @Software: PyCharm

import math # 关于数学运算
print(id(math))
print(type(math))

print(math.pi)
print(dir(math))

print(math.pow(2,3),type(math.pow(2,3))) # 2的三次方

print(math.ceil(9.01)) # 向上取整

print(math.floor(9.99))#向下取整

猜你喜欢

转载自blog.csdn.net/qq_34608447/article/details/111117765