Type Hints
list[int], dict[str, float], Optional, Union, and TypedDict
25 min · interactive lesson with runnable code and 5 graded exercises.
What you'll be able to do
- Annotate parameters, returns, and containers
- Explain that hints are not enforced at runtime
- Use Optional / X | None and Union correctly
- Describe dict-shaped data with TypedDict
The full lesson is free with an account.