Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 74)
74.
What is the purpose of the itertools.dropwhile() function when used with generators?
It drops the first element from the generator
It skips elements until a certain condition is false
It stops the generator after one iteration
It filters elements based on a specified condition
Answer: Option
Explanation:
itertools.dropwhile() skips elements from the generator until the specified condition becomes false, after which it yields the remaining elements.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.