1. 使用`import math`语句导入整个`math`模块。
2. 使用`from math import *`语句导入`math`模块中的所有函数和常量。
3. 如果你只需要使用`math`模块中的特定函数或常量,可以使用`from math import function_name`语句导入。
导入后,你可以使用`math`模块中的函数和常量,例如计算平方根、获取圆周率等。例如:
```python
import math
计算平方根
sqrt_result = math.sqrt(16)
print("平方根结果:", sqrt_result)
获取圆周率的值
pi_value = math.pi
print("圆周率的值:", pi_value)