Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Explain the purpose of 'yield from'.
Think about how nesting generates benefits.
What does yield from return?
Consider what happens when you loop through a collection.
What does the yield from statement do?
Think about how it simplifies nested generators.
True or False? yield from can only be used with lists.
Consider all possible data structures that can be iterated.
Create a generator that accepts an iterable and returns only the even numbers while using yield from.
Consider which criteria must be satisfied to yield a value.
Using yield from, create a pipeline that takes a list, squares the numbers, then filters for even results.
You will need to combine multiple functions into one.
4 more questions in this section. Enroll free to practise them all.
Enroll free