Loading lesson…
Level 1 · Apprentice0 XP
Make Python feel like Kotlin: precise types, structural interfaces, and a checker in CI.
Step 1 / 6
ProblemA function returns str | None but callers treat it as str. In production, a missing summary crashes the pipeline with AttributeError: 'NoneType' has no attribute 'strip'.
← → step
Before this: Generators, iterators and context managers
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Define a ChatModel Protocol, two implementations (a real client and a fake), and a function that depends only on the Protocol. Turn on pyright strict mode and fix every error.