Skip to content
← All Python tracks

Generators, Iterators and Streaming Data

Python

Chain generators into pipelines that read one item at a time, so you can process data too big to hold in memory. Learn when each step runs, how to type iterables and iterators, and how to batch and join streams.

This track uses Python. You can make it your practice mode to browse related content across the site.

6 exercises

3 articles

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Catch Mismatched Lengths with zip(strict=True) Read
  2. 2 Not solved yet. Pair Names with Scores and Reject a Length Mismatch Practice · Easy
  3. 3 Process Data Too Big for a List with Generators Read
  4. 4 Not solved yet. Build a Pipeline from Small Generators Practice · Easy
  5. 5 Not solved yet. Parse Records in Batches with a Generator Practice · Medium
  6. 6 Choose Between Iterable, Iterator and Sequence Read
  7. 7 Not solved yet. Copy a One-Shot Iterator into Separate Lists Practice · Medium
  8. 8 Not solved yet. Join Two Sorted Streams Without Loading Them Practice · Hard
  9. 9 Not solved yet. Build a Streaming Pipeline from Start to Finish Practice · Hard

Check yourself

6 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 6 correct

What do these two calls do when the inputs have different lengths?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

print(list(zip([1, 2, 3], [1, 2])))
print(list(zip([1, 2, 3], [1, 2], strict=True)))
Question 1 of 6