python find multiple substrings in string code example
Example 1: function to find multiple substring in given string
matches = ["more", "wholesome", "milk"]
a_string = "A string is more than its parts! milk, wholesome"
if any(x not in a_string for x in matches):
print "missing"
Example 2: python find multiple matches in string
a_string = "A string is more than its parts!"
matches = ["more", "wholesome", "milk"]
if any(x in a_string for x in matches):