Custom Filter over a Generator
Explain what a Python generator is, and implement a custom generator function my_filter(pred, iterable) that takes a predicate and an iterable (a sequence or another generator) and lazily yields the...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
