Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 3)
3.
How can you create a generator object?
Using the new_generator() constructor
By calling a generator function with gen_func()
Using the Generator() class
By applying the yield keyword in any function
Answer: Option
Explanation:
A generator object is created by calling a generator function using its name followed by parentheses, such as gen_func().
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.