📜  python 键入为 int 或 float - Python 代码示例

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

代码示例1
from typing import Union
# Usage:
Union[type1, type2]

# Exemple:
weight : Union[int, float]
# or
def return_triple( number : Union[int, float]) -> Union[int, float]:
    return number*2