unnested
Pro

© 2026 unnested

Built for learners, by learners

AboutPrivacy PolicyTerms of ServiceContactSuggest a feature
Learn Python

Iterators & Generators

13 questions

OutputEasy
iter() and next() on a list
Multiple choiceEasy
What signals exhaustion in the iterator protocol
OutputEasy
Basic generator function output
VocabularyEasy
What yield does
OutputMedium

Sign in to save your progress.

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