Caveat when removing elements from Python list or dict
There is a caveat when removing duplications from a list in Python using for loop. One thing you have to keep in mind to make it correct is, that you need to iterate over a copy of the list, not the list itself.
Suppose you have this...