Answers for "python int or float typing"

2

python typing as int or float

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
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language