如何列出数学模块中的所有函数?

时间:2017-05-03 08:37:49

标签: python

有没有办法找出数学模块中的所有函数是什么?我不知道如何找到它。我试过搜索它,但它直接告诉我它们是什么而不是内置的帮助

1 个答案:

答案 0 :(得分:3)

import math
for method in dir(math):
    print method

输出:

__doc__
__name__
__package__
acos
acosh
asin
asinh
atan
atan2
atanh
ceil
copysign
cos
cosh
degrees
e
erf
erfc
exp
expm1
fabs
factorial
floor
fmod
frexp
fsum
gamma
hypot
isinf
isnan
ldexp
lgamma
log
log10
log1p
modf
pi
pow
radians
sin
sinh
sqrt
tan
tanh
trunc