<p>So I'm teaching myself Python, and I'm having an issue with lists. I want to pass my function a list and pop items off it while retaining the original list. How do I make python "instance" the passed list rather that passing a pointer to the original one?</p>

<p>Example:</p>

<pre><code>def burninate(b):
    c = []
    for i in range(3):
        c.append(b.pop())
    return c

a = range(6)
d = burninate(a)
print a, d
</code></pre>

<p>Output: [0, 1, 2] [5, 4, 3]<br>
Desired output: [0, 1, 2, 3, 4, 5] [5, 4, 3]</p>

<p>Thanks!</p>

You can call
```
burninate()
```
with a copy of the list like this:
```
d = burninate(a[:])
```
or,
```
d = burninate(list(a))
```
The other alternative is to make a copy of the list in your method:
```
```
def burninate(b):
    c=[]
    b=b[:]
    for i in range(3):
        c.append(b.pop())
    return c

>>> a = range(6)
>>> b = burninate(a)
>>> print a, b
>>> [0, 1, 2, 3, 4, 5] [5, 4, 3]
```
```