def takewhile_including(iterable, value):
    for it in iterable:
        yield it
if it == value:
    return
l1 = ['apple', 'pear', 'grapes', 'banana']
print(('Until pear', list(takewhile_including(l1, 'pear'))))
print(('Until blah', list(takewhile_including(l1, 'blah'))))
Remove all elements from a list after a particular value