Python文档字符串

import math
dir(math)
['__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']
math.ceil.__doc__
'ceil(x)\n\nReturn the ceiling of x as a float.\nThis is the smallest integral value >= x.'
 help(math.pow)
Help on built-in function pow in module math:

pow(...)
    pow(x, y)
    
    Return x**y (x to the power of y).

dir(math):显示math的方法

math.ceil.__doc__:ceil方法的介绍(英文两道下划线)

help(math.pow):pow方法的声明


你可能感兴趣的:(python,文档字符串)