title: How to delete list elements in one list based on content of another list?
body: <p>I have a problem with my list comprehension in python. I have a string variable with search queries, like this:</p>
  
  <pre><code>queries = 'news, online movies, weather, golden rush, online sports, price 
  of the golden ring, today weather, python'
  </code></pre>
  
  <p>And I have a list of 2 elements:</p>
  
  <pre><code>words = [ 'online', 'golden' ]
  </code></pre>
  
  <p>And I need to filter queries string with the list words, such that the final result will not include queries which have 'online' and 'golden' in its content.</p>
  
  <p>I've tried this, but it doesn't work properly:</p>
  
  <pre><code>filteredquerry = [] 
  queriesNew = queries.split(',')
  
  for x in queriesNew:
      if x not in words:
          filteredquerry.append(x)
      else:
          break
  
  print(filteredquerry)
  </code></pre>
  
  <p>Also I have tried another way of list 'filtering' using a list methods, but it gives me an error or gives back an empty list:</p>
  
  <pre><code>print( [ x for x in queries if x not in words ]
  </code></pre>
  
  <p>The expected result should look like this:</p>
  
  <pre><code>filteredquerry = ['news', 'weather', 'today weather', 'python']
  </code></pre>