在python中使用“""""""”符号为函数添加注释,具体方法如下:
def func(name:str= "",age:int ="") -> (str,int):""":param name::param age::return:"""return '{0}:{1}'.format(name,age)print(func()) print(func('姓名',18))
def func(name:str= "",age:int ="") -> (str,int):
"""
:param name:
:param age:
:return:
return '{0}:{1}'.format(name,age)
print(func())
print(func('姓名',18))