I have a list called words
containing words which may be in upper or lower case, or some combination of them. Then I have another list called stopwords
Make your word lowercase so you don't need to worry about casing:
words = ['This', 'is', 'a', 'test', 'string']
stopwords = {'this', 'test'}
print([i for i in words if i.lower() not in stopwords])
Outputs:
['is', 'a', 'string']
As an additional note, per @cricket_007 (and thanks to @chepner for the correction) comment, making stopwords a set would make it more performant. Notice the change to stopwords above making it a set instead of a list.