Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What are the methods that an iterator must implement?
Think about how iteration works in Python.
What keyword do we use to define a generator function?
This keyword is also used for pausing functions.
What must an object implement to be considered an iterator?
Recall the components of the iterator protocol.
True or False: A generator can return multiple values at once.
Think of how yield works in a generator function.
Create a generator that produces Fibonacci numbers infinitely until a specified limit is reached.
Think about the Fibonacci sequence's recursive nature and structure.
Construct a data processing pipeline that takes a list, filters odd numbers, and returns their squares.
Refer back to how we built the pipeline in the examples.
6 more questions in this section. Enroll free to practise them all.
Enroll free