title: Removing list of words from a string
body: <p>I have a list of stopwords. And I have a search string. I want to remove the words from the string.  </p>
  
  <p>As an example:  </p>
  
  <pre><code>stopwords=['what','who','is','a','at','is','he']
  query='What is hello'
  </code></pre>
  
  <p>Now the code should strip 'What' and 'is'. However in my case it strips 'a', as well as 'at'. I have given my code below. What could I be doing wrong?  </p>
  
  <pre><code>for word in stopwords:
      if word in query:
          print word
          query=query.replace(word,"")
  </code></pre>
  
  <p>If the input query is "What is Hello", I get the output as:<br>
  <code>wht s llo</code></p>
  
  <p>Why does this happen?</p>