Question: For quite a bit of time now I have been trying to figure out a way to loop through a list and remove the current item that I'm at. I can't seem to get this working as I would like it to. It loops just 1 time through, but I wanted it to loop 2 times. When I remove the removal line - it loops 2 times.

```
a = [0, 1]
for i in a:
    z = a
    print z.remove(i)

```

The output:

```
[1]

```

The output that I was expecting:

```
[1] 
[0]

```

Answer: 
The problem is that you're modifying `a` with `remove` so the loop exits because the index is now past the end of it.
Don't try to remove multiple items of a list while looping the list. I think it's a general rule you should follow not only in python but also in other programming languages as well.

You could add the item to be removed into a separate list. And then remove all objects in that new list from the original list.