Type hints say what a function expects and returns: def net_price(price: float, discount: float) -> float:. Editors use them for autocomplete, tools such as mypy check them, and colleagues read them as documentation.
For containers, put the item types in brackets: list[str], dict[str, float], tuple[int, int], list[dict[str, float]]. A value that may be missing is str | None (older code writes Optional[str]).
Hints are not checked or applied when the code runs. def add(a: int, b: int) called with "2" and "3" happily returns "23". If input arrives as text, convert it yourself.
The hints are stored on the function in __annotations__, which is how the checker reads yours. Dataclass fields are type hints too.