unnested
Explore
Pro
Sign in
Learn Python
Iterators & Generators
13 questions
Output
Easy
iter() and next() on a list
Multiple choice
Easy
What signals exhaustion in the iterator protocol
Output
Easy
Basic generator function output
Vocabulary
Easy
What yield does
Output
Medium
Sign in
to save your progress.
Iterating an exhausted generator twice
Output
Medium
yield from flattens nested iterables
Multiple choice
Medium
Why generators are memory-efficient
Output
Medium
Calling a generator function does not run its body
Vocabulary
Medium
Generator expression
Vocabulary
Medium
__iter__ and __next__
Output
Hard
Infinite generator with selective next() calls
Output
Hard
Mixing next() with a for loop on the same iterator
Multiple choice
Hard
Iterables vs iterators - the key distinction