Skip to main content

Practice · 3 of 3

Typed Payload

CHALLENGE
Difficulty: intermediate+25 XP

Define a TypedDict ProductDict with keys sku: str and price: float. Then implement total_price(items: list[ProductDict]) -> float summing prices. get_type_hints(ProductDict) must show both annotations.

Back to lesson: Practice: Annotation Drills