python throws_Python 2.7 throws ValueError: list.remove(x): x not in list
Youshouldnotremoveitemsfromalistyouareloopingover.Createacopyinstead:forainaliens[:]:andforbinbolts[:]:Modifyingalistwhileloopingoverit,affectstheloop:>>>lst=[1,2,3]>>>foriinlst:...printi...lst.remove