I am trying to remove elements from the list if the element is even ,the code runs partially it does not removes 12 from it .I have been stuck at this point does anyone have an idea what is the problem and what can be the optimized solution for it?
lst=[0,3,5,8,12,2] #created a list
for i in lst:
if(i%2==0):
lst.remove(i) #removes elements from the list
print(lst)
O/P:[3, 5, 12]