python 帮助文档,撰写函数文档,并查看函数文档

python 帮助文档,撰写函数文档,并查看函数文档

定义函数

def test(a,b):
    '''
    参数:a:整数
          b:整数
    返回值:a+b
    '''
    return a+b

运行函数

test(11,22)

33

查看帮助文档

help(test)

Help on function test in module main:
      
    test(a, b)
        参数:a:整数
              b:整数
        返回值:a+b

发布了132 篇原创文章 · 获赞 30 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/weixin_44493841/article/details/103512427