Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 26)
26.
How does the itertools.zip_longest() function behave when used with generators?
It creates pairs of values from the generators
It combines values from the generators until the shortest one is exhausted
It stops the generators after one iteration
It interleaves values from different generators
Answer: Option
Explanation:
itertools.zip_longest() combines values from multiple generators until the shortest generator is exhausted. It fills missing values with a specified fill value.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.