python中math.pi()是什么意思
2 回答
![?](http://img1.sycdn.imooc.com/545850200001359c02200220-100-100.jpg)
杨__羊羊
TA贡献1943条经验 获得超7个赞
就是圆周率数值
用于数学计算
死记硬背个圆周率 不是程序员的作风~
以下是用法
>>> import math
>>> math.pi
3.141592653589793
>>>
![?](http://img1.sycdn.imooc.com/54584cde0001d19202200220-100-100.jpg)
眼眸繁星
TA贡献1873条经验 获得超9个赞
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.pi()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'float' object is not callable
>>> math.pi
3.141592653589793
>>>
添加回答
举报
0/150
提交
取消