My code looks like this:
def nue(li):
for i in li:
li.remove(i)
print(li)
li = [1, 2, 3]
nue(li)
However, running this results in:
>>> [2]
More generally, how do I remove the i-th position on a list while iterating over the list (for reasons it failed some test in a nested loop or something like that)?