Python基础之函数的文档说明
>>> def test(a,b):
'''用来完成对2个数求和'''
print("%d"%(a+b))
>>>
>>> test(11,22)
33
如果执行,以下代码
>>> help(test)
能够看到test函数的相关说明
Help on function test in module __main__:
test(a, b)
用来完成对2个数求和
(END)
还可以用 test.doc 直接查看文档说明
>>> def test(a,b):
"用来完成对2个数求和"
print("%d"%(a+b))
>>>
>>> print(test.__doc__)
用来完成对2个数求和
#######------------我是分界线------------######
阅读原文免费获取Python经典学习书本大礼包**(20余本):
https://blog.youkuaiyun.com/weixin_43750386/article/details/106004054
阅读原文免费获取R语言经典学习书本大礼包(10余本):
https://blog.youkuaiyun.com/weixin_43750386/article/details/106004281