from pprint import *
sites = [[\'a\',\'b\',\'c\'],[\'d\',\'e\',\'f\'],[1,2,3]]
pprint(sites)
for site in sites:
sites.remove(site)
pprint(sites)
<
Because resizing a collection while iterating over it is the Python equivalent to undefined behaviour in C and C++. You may get an exception or subtly wrong behaviour. Just don't do it. In this particular case, what likely happens under the hood is:
remove
operation, the item at index 1 is the item that started out at index 2 (the last item).