remove items from a list while iterating without using extra memory in python,li = [x for x in li if condition(x)]