Not sure if I am doing anything silly here but I am trying to remove all items in a list which starts with 00:00:00.
but not all items are matched.
tc = ['00:00:00.360', '00:00:00.920', '00:00:00.060', '00:00:02.600', '00:00:05.960', '00:00:01.040', '00:00:01.140', '00:00:01.060', '00:00:01.480', '00:00:00.140', '00:00:00.280', '00:00:01.200', '00:00:00.400', '00:00:01.220', '00:00:00.380']
for item in tc:
if item.startswith(str('00:00:00.')):
tc.remove(item)
print (tc)
Result:
['00:00:00.920', '00:00:02.600', '00:00:05.960', '00:00:01.040', '00:00:01.140', '00:00:01.060', '00:00:01.480', '00:00:00.280', '00:00:01.200', '00:00:01.220']
Expected Result:
['00:00:02.600', '00:00:05.960', '00:00:01.040', '00:00:01.140', '00:00:01.060', '00:00:01.480', '00:00:01.200', '00:00:01.220']
Any idea what could be the issue here?