python check if string contains two characters code example
Example: check if multiple characters is in string python
def containsAny(str, set):
""" Check whether sequence str contains ANY of the items in set. """
return 1 in [c in str for c in set]
def containsAll(str, set):
""" Check whether sequence str contains ALL of the items in set. """
return 0 not in [c in str for c in set]