Using Python's replace() method to implement stopword functionality
<p>I am trying to strip substrings out of each element in a list of strings. I am having trouble figuring out how to handle the case of a string having multiple substrings (stopwords) that I want to remove.</p>

<pre><code>wines = ("2008 Chardonnay", "Cabernet Sauvignon 2009", "Bordeaux 2005 Cotes du Rhone")
stop_words = ("2005", "2008", "2009", "Cotes du Rhone")
result = []

for wine in wines:
    for stop in stop_words:
        if stop in wine:
            x = wine.replace(stop, "")
            result.append(x)

print result
</code></pre>

<p>Changing the if statement to a for or a while returns garbage or hangs. Any advice?</p>
