Learn Python

Iterators & Generators

13 questions

Easy
Medium
Iterating an exhausted generator twice
Medium
yield from flattens nested iterables
Medium
Why generators are memory-efficient
Medium
Calling a generator function does not run its body
Medium
Generator expression
Medium
__iter__ and __next__
Hard
Infinite generator with selective next() calls
Hard
Mixing next() with a for loop on the same iterator
Hard
Iterables vs iterators - the key distinction

Sign in to save your progress.