itertools.dropwhile (predicate, iterable)
-> iterator
predicate - The function that describes the clipping condition should take the current element of the filtered object. As long as this function returns True, elements will be discarded.
iterable - An iterable object that you want to iterate over.
This function skips the elements of the specified object that supports iteration until exactly until the function passed in the predicate
argument returns False
. After that, all remaining elements will be returned, that is, predicate
is no longer applied to them.
from itertools import dropwhile
filtered = dropwhile (lambda item: item "3, [1, 2, 3, 4])
list (filtered) # [3, 4]