Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 85)
85.
How does the itertools.dropwhile() function differ from itertools.filterfalse() when used with generators?
They are equivalent in functionality
itertools.dropwhile() skips elements until a specified condition becomes false, while itertools.filterfalse() filters elements based on a false condition
itertools.filterfalse() skips elements until a specified condition becomes false, while itertools.dropwhile() filters elements based on a false condition
itertools.dropwhile() and itertools.filterfalse() both raise a ValueError
Answer: Option
Explanation:
itertools.dropwhile() skips elements until a specified condition becomes false, while itertools.filterfalse() filters elements based on a false condition.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.