函数注解学习

函数注解学习_第1张图片

def hanshuzhujie(a:str,b: str ='m')->str:
    print(hanshuzhujie.__annotations__)


    return a+b
hanshuzhujie('qqq')

运营结果

E:\Python\Python38\python.exe D:/pythonprojects/python-auto-test/test/hanshuzhujie.py
{'a': <class 'str'>, 'b': <class 'str'>, 'return': <class 'str'>}

Process finished with exit code 0

你可能感兴趣的:(学习,数据库,前端,python)