Python – Itertools.dropwhile()
Itertools is a Python module that provide various functions that work on iterators to produce complex iterators. It makes the code faster, memory efficient and thus we see a better performance. This module is either used by themselves or in combination to form iterator algebra.
Note: For more information, refer to Python Itertools
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
dropwhile() function of Python returns an iterator only after the
func. in argument returns
false for the first time.
[-8, -4, 2]
The values after condition returns false : [5, 7, 8]