Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Last active July 20, 2019 06:15
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 eyaltrabelsi/ec4b157dc0132c765369e0b8e18cfdb6 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/ec4b157dc0132c765369e0b8e18cfdb6 to your computer and use it in GitHub Desktop.
Python tricks check if any elements in iterable hold predicate of iterables
>>> any(a % 2==0 for a in range(0,10,2))
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment