Python Programming - Generators - Discussion
Discussion Forum : Generators - General Questions (Q.No. 78)
78.
How does the
itertools.tee()
function differ from itertools.cycle()
when used with generators?
Answer: Option
Explanation:
itertools.tee()
creates multiple independent iterators from a single generator, allowing each iterator to consume the elements separately. itertools.cycle()
repeats the elements of a generator indefinitely.
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