We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Generators, Iterators and Streaming Data
PythonChain 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.
Your learning sequence
- 1 Catch Mismatched Lengths with zip(strict=True) Read
- 2 Not solved yet. Pair Names with Scores and Reject a Length Mismatch Practice · Easy
- 3 Process Data Too Big for a List with Generators Read
- 4 Not solved yet. Build a Pipeline from Small Generators Practice · Easy
- 5 Not solved yet. Parse Records in Batches with a Generator Practice · Medium
- 6 Choose Between Iterable, Iterator and Sequence Read
- 7 Not solved yet. Copy a One-Shot Iterator into Separate Lists Practice · Medium
- 8 Not solved yet. Join Two Sorted Streams Without Loading Them Practice · Hard
- 9 Not solved yet. Build a Streaming Pipeline from Start to Finish Practice · Hard
Check yourself
6 questions · not saved while you're signed outUse these questions to check your understanding and compare explanations. Your score does not affect track completion.
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)))