Iterators & Generators in Python: interview exercises
Iterators & Generators in Python: 5 test-checked interview exercises (An endless generator), each beside a worked example, with tests as you go. Free.
- An endless generator
- Chunk any iterable, lazily
- Filter a stream, remembering the past
- Make a class iterable
- A lazy pipeline over lines
Each exercise pairs a worked example with a twin problem to solve in a real editor; the tests run the moment you do. Progress is saved in your browser, and in your account if you sign in.