Skip to content

Instantly share code, notes, and snippets.

@MarkRoddy
Created February 23, 2015 20:19
Show Gist options
  • Save MarkRoddy/381064b0cc6a74db1502 to your computer and use it in GitHub Desktop.
Save MarkRoddy/381064b0cc6a74db1502 to your computer and use it in GitHub Desktop.
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