remove items from a list while iterating,somelist[:] = [x for x in somelist if not determine(x)]