I have a for loop that is supposed to remove all string-items from a list that contain '0'. However, it only removes some of them.
for e in l:
if '0' in e:
l.remove(e)
In my case l
is a list of integers turned into strings, In my test run this list looked like this before executing the for loop:
['12345', '23456', '34567', '45678', '56789', '67891', '78910', '89101', '91011', '10111', '01112', '11121', '11214', '12141', '21414', '14145', '41455', '14555', '45550', '55500', '55008', '50088', '00887']
And after that like this:
['12345', '23456', '34567', '45678', '56789', '67891', '89101', '10111', '11121', '11214', '12141', '21414', '14145', '41455', '14555', '55500', '50088']
There were only six elements removed, some elements wich still contain '0' are however still left.