Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Created October 27, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kush1101/7f59c245d6fa37739e2aa6b6e80ed869 to your computer and use it in GitHub Desktop.
Save Kush1101/7f59c245d6fa37739e2aa6b6e80ed869 to your computer and use it in GitHub Desktop.
from itertools import filterfalse
iterable = [1, 3, 5, 7, 2, 4, 6, 9, 11]
predicate = lambda x: x%2==0
for i in filterfalse(predicate, iterable):
print(i, end = ' ')
# OUTPUT
"""
1 3 5 7 9 11
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment