Python Programming - Generators - Discussion
Discussion Forum : Generators - General Questions (Q.No. 11)
11.
How can you stop the execution of a generator prematurely?
Answer: Option
Explanation:
To stop the execution of a generator prematurely, you can use the
break
statement within the generator function. This will exit the generator's loop.
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