Created
February 23, 2015 20:19
-
-
Save MarkRoddy/381064b0cc6a74db1502 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
mark@localhost:~$ python | |
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) | |
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> s = "foo bar baz biz" | |
>>> all(map(s.__contains__, ["foo", "bar", "baz"])) | |
True | |
>>> all(map(s.__contains__, ["foo", "bar", "baz", "bitz"])) | |
False | |
>>> any(map(s.__contains__, ["foo", "bar", "baz", "bitz"])) | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment