Altering list while iterating
<p>Python noob here. I have a list of numbers represented as strings. Single digit numbers are represented with a zero and I'm trying to get rid of the zeroes. For instance, ['01', '21', '03'] should be ['1', '21', '3']. </p>

<p>My current solution seems a bit clumsy:</p>

<pre><code>for item in list:  
    if item[0] == '0':     
        list[list.index(item)] = item[1]
</code></pre>

<p>I'm wondering why this doesn't work:</p>

<pre><code>for item in list:  
    if item[0] == '0':  
        item = item[1]
</code></pre>
