AlgoGymPreparationInterview Preparations
Cool NotesPython iterators and generators
All notes

Python iterators and generators

Languages · Original AlgoGym revision note with a source for deeper study.

Languages
  1. An iterator yields values one at a time and tracks its own traversal state.
  2. A generator suspends at yield and resumes later, making pipelines memory-efficient.
  3. Generators are single-use; materialize only when repeated traversal is required.
Read more at Python documentation