Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Last active July 20, 2019 06:14
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/ed54a0e6a2ba5babe551a8cdb93c23f9 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/ed54a0e6a2ba5babe551a8cdb93c23f9 to your computer and use it in GitHub Desktop.
Python tricks check if all elements in iterable hold predicate of iterables
>>> all(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