Petri Lehtinen added the comment:
This happens because you modify the list while iterating over it, which makes
the loop not work as you expect. Essentially, when you remove the item that's
currently being pointed to, the loop skips over the next item.
An idiomatic way to remove items from a
New submission from Isaac :
The simple repro below, shows that if a list of strings has two consecutive
items that begin with the same letter, an iteration over the list to find and
remove all strings that start with that letter fails. The second string that
starts with the same letter to rem