📜  python 类型注释 - Python 代码示例

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

代码示例2
# 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]