Last active
July 20, 2019 06:15
-
-
Save eyaltrabelsi/ec4b157dc0132c765369e0b8e18cfdb6 to your computer and use it in GitHub Desktop.
Python tricks check if any 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
>>> 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