>>> from itertools import takewhile
>>> help(takewhile)
Help on class takewhile in module itertools:
class takewhile(builtins.object)
| takewhile(predicate, iterable) --> takewhile object
|
| Return successive entries from an iterable as long as the
| predicate evaluates to true for each entry.