Python Quest

Track 12 · Lesson 3 of 12

Generator expressions and pipelines

Chain small lazy stages into data pipelines with generator expressions and yield from, and see why they use so little memory.

About 45 minIntermediate4 exercises

You will be able to

  • Write generator expressions and pass them directly to sum(), max(), any() and similar functions
  • Build a pipeline of generator stages that each do one job
  • Explain the order in which a lazy pipeline processes items and why it saves memory
  • Delegate to another iterable or recursive generator with yield from

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.