what's the difference between two kinds of iteration of list
<p>Here is my code
i got two different output which are [2] and [2,4,6], can someone do some explanation? </p>

<pre><code>list = [1,2,3]
def getdouble(l):
    result = []
    for i in l :
        i = i * 2
        result.append(i)
    return result

print getdouble(list)

def getdouble_v2 (l):
    result = []
    for i in range(len(l)):
        l[i] = l[i] * 2
        result.append(l[i])
    return result

print getdouble_v2(list)
</code></pre>
