Skip to content

Instantly share code, notes, and snippets.

@miratcan
Created February 10, 2015 09:48
Show Gist options
  • Save miratcan/b382467fbbee84a02319 to your computer and use it in GitHub Desktop.
Save miratcan/b382467fbbee84a02319 to your computer and use it in GitHub Desktop.
Find if a string present at list of strings.
def issubset(text, list_of_text):
"""
>>> msgs = ["abc", "def", "efg"]
>>> issubset("ab", msgs) # is subset of first item in msgs
True
>>> issubset("az", msgs)
False
>>> issubset("ef", msgs)
True
"""
return any([t in text for t in list_of_text])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment