Skip to main content

Practice ยท 1 of 3

Annotated Average

Implement average(values: list[float]) -> float that raises ValueError on an empty list. The annotations must be exactly list[float] and float (verifyable via typing.get_type_hints).

Difficulty: intermediate

Back to lesson: Practice: Annotation Drills