How do I remove words from a List in a case-insensitive manner?
<p>I have a list called <code>words</code> containing words which may be in upper or lower case, or some combination of them. Then I have another list called <code>stopwords</code> which contains only lowercase words. Now I want to go through each word in <code>stopwords</code> and remove all instances of that word from <code>words</code> in a case-insensitive manner, but I don't know how to do this. Suggestions?</p>

<p>Example:</p>

<pre><code>words = ['This', 'is', 'a', 'test', 'string']
stopwords = ['this', 'test']

for stopword in stopwords:
    if stopword in words:
        words.remove(stopword);

print words
</code></pre>

<p>The result shown is this: <code>['This', 'is', 'a', 'string']</code></p>

<p>The correct return should have been this: <code>['is', 'a', 'string']</code></p>