I've got the following simple for loop.
for word in text:
if word in stopword_list:
text.remove(word)
So far it has worked for removing any item found on the stopword_list. However if two of these items are next to each other, it ignores the second. For example:
stopword_list = (['i', 'am'])
'i'
or 'am'
individually will be removed
(['I', 'x', 'y', 'am'])
will remove both 'I'
and 'am'
(['I', 'am'])
will remove 'I'
but not 'am'
If I run the list itself through the loop, it removes every other word.
Why is this happening?