stopWords = ['the', 'and', 'with']
msg = 'kill the fox and the dog'
""" """.join([w for w in msg.split() if w not in stopWords])
If I have a list of words, how can I check if string does not contain any of the words in the list, and efficiently?