What does a yield inside a yield do?
What does a yield inside a yield do? Question: Consider the following code: def mygen(): yield (yield 1) a = mygen() print(next(a)) print(next(a)) The output yields: 1 None What does the interpreter do at the “outside” yield exactly? Asked By: David || Source Answers: Any generator exhausts elements till it runs out of them. In …