Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 9)
9.
What is the advantage of using the yield from statement in a generator function?
It replaces the yield keyword
It simplifies the generator function syntax
It allows delegation to another generator
It is used for generator initialization
Answer: Option
Explanation:
The yield from statement in a generator function allows delegation to another generator, simplifying the syntax and enabling one generator to yield values from another.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.