Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 30)
30.
What is the purpose of the itertools.groupby() function when used with generators?
It groups consecutive equal elements from the generator
It interleaves values from different generators
It stops the generator after one iteration
It creates pairs of values from the generators
Answer: Option
Explanation:
itertools.groupby() groups consecutive equal elements from the generator based on a key function.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.