Python Programming - Generators - Discussion
Discussion Forum : Generators - General Questions (Q.No. 80)
80.
How does the
generator.close()
method differ from generator.throw(GeneratorExit)
?
Answer: Option
Explanation:
generator.close()
raises a GeneratorExit
exception to signal that the generator should be closed. generator.throw(GeneratorExit)
is not a common approach for closing generators.
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