Last active
July 20, 2019 06:14
-
-
Save eyaltrabelsi/ed54a0e6a2ba5babe551a8cdb93c23f9 to your computer and use it in GitHub Desktop.
Python tricks check if all elements in iterable hold predicate of iterables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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