python中math.pi()是什么意思
2 回答

楊__羊羊
TA貢獻1943條經(jīng)驗 獲得超7個贊
就是圓周率數(shù)值
用于數(shù)學(xué)計算
死記硬背個圓周率 不是程序員的作風(fēng)~
以下是用法
>>> import math
>>> math.pi
3.141592653589793
>>>

眼眸繁星
TA貢獻1873條經(jīng)驗 獲得超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
提交
取消