Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Created October 27, 2020 11:15
Embed
What would you like to do?
from itertools import dropwhile
iterable = [1, 3, 5, 7, 2, 4, 6, 9, 11]
predicate = lambda x: x%2==1
for i in dropwhile(predicate, iterable):
print(i, end = ' ')
# OUTPUT
"""
2 4 6 9 11
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment