I am a python programmer and I was using the remove function from a list. The problem is that it shows me the item that I am trying to remove. Here is the code that I wrote.
set1 = [10, 10, 10, 2, 4, 0]
for i in set1:
if i < 9:
set1.remove(i)
print(set1)
And this is the output
[10, 10, 10, 4]
Why does it show a 4? What can I do?