I wrote the function which supposed to remove minus values from the list. Function removes all minus values except -3 and i have no idea why
def trzecia():
lista = [2, -1, 3, -2, -3]
for x in lista:
if x < 0:
lista.remove(x)
print(lista)
trzecia()
Could someone explain me why -3 is still on list?