Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 30)
30.
Consider the following Python code:
def my_generator():
yield 1
yield 2
yield 3
result = list(my_generator())
print(result)
What will be the output of this code?
Answer: Option
Explanation:
The generator function is converted to a list using the
list()
constructor.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers