Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 15)
15.
How can you pass a value to a generator function from the outside?
Using the send() method
Using the pass_value() function
By modifying the generator function's arguments
It is not possible to pass values to a generator function
Answer: Option
Explanation:
The send() method allows you to pass a value to a generator function from the outside. This value becomes the result of the yield expression.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.