涉及π值计算的时候,我们可以直接调用SciPy库中的常量PI。打印 PI 的常量值:from scipy import constantsprint(constants.pi)执行结果:3.141592653589793