Python Programming - Generators - Discussion
Discussion Forum : Generators - General Questions (Q.No. 31)
31.
How does the
generator.__iter__()
method differ from the iter()
built-in function when applied to a generator?
Answer: Option
Explanation:
generator.__iter__()
returns the generator itself, treating the generator as its own iterator. iter()
returns a new iterator object for the generator.
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