 <p>try:</p> <pre><code>myWords=['some', 'supplied','words'] theTextContents='a string that might or might not have all of some supplied words' goodElements=[] splitted = theTextContents.split() if all(word in splitted for word in myWords): goodElements.append(theTextContents) </code></pre>