📜  python 设置返回类型 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:54.493000             🧑  作者: Mango

代码示例1
# This example illustrates both parameter and return type annotation
# Collection annotations are also supported
from typing import List

def greeting(names: List[str]) -> str:
    return 'Hello, ' + names[0] ' and ' + names[1]