Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 51)
51.
What is the purpose of the itertools.tee() function when used with generators?
It creates an exact copy of the generator
It filters elements based on a specified condition
It stops the generator after one iteration
It interleaves values from different generators
Answer: Option
Explanation:
itertools.tee() creates an exact copy of the generator, allowing multiple independent iterators over the same sequence.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.