Typed Note Service
Challenge on lesson: Checkpoint: A Typed Application Slice
CHALLENGE
Difficulty: intermediate+25 XP
Define TypedDict NoteDict(id: int, text: str), a @runtime_checkable Protocol NoteStore with add(note_id: int, text: str) -> None and get(note_id: int) -> str | None, class MemoryNotes implementing both, and function save_note(store: NoteStore, note: NoteDict) -> bool that raises ValueError when note['text'] is empty/whitespace, otherwise stores and returns True.
Press Submit to check your solution.
Back to lesson: Checkpoint: A Typed Application Slice