It is not a good idea to modify a list while iterating over it.