Open this example in the interactive library
Source code
def area(width: float, height: float) -> float:
return width * height
print(area(3.5, 2))Sample output
7.0

Annotate a function. A self-contained example using the Python standard library.
Open this example in the interactive library
def area(width: float, height: float) -> float:
return width * height
print(area(3.5, 2))7.0