I'm trying to remove a duplicate element from a list, it is not able to remove it ("1"), can somebody explain what I'm doing wrong
lst=[1,2,3,4,1,1,1,5,6,7,1,2]
for i in lst:
print(i)
if i==1:
lst.remove(i)
expected output -
[2,3,4,5,6,7,2]
actual output -
[2,3,4,5,6,7,1,2]