How do I assign incremental names to elements of a list?
<p>How do I assign incremental names in a list?</p>

<pre><code>&gt;&gt;&gt; ccList
['az &lt;az@example.com&gt;', 'cc777 &lt;cc777@example.com&gt;', 'user11 &lt;user11@example.com&gt;']
&gt;&gt;&gt; for i in range(len(ccList)):
    mailTuple = parseaddr(ccList[i])
    cc = mailTuple[0]
    print cc

az
cc777
user11
&gt;&gt;&gt; 
&gt;&gt;&gt; for i in range(3):
    name = "name"+str(i)
    print name

name0
name1
name2
&gt;&gt;&gt;
</code></pre>

<p>I was trying to end up with </p>

<pre><code>name0 = az
name1 = cc77
name2 = user11
</code></pre>

<p>so that I can refer to these names later. How can I do this? Basically, I don't understand how to write this:</p>

<pre><code>&gt;&gt;&gt; for i in range(len(ccList)):
    mailTuple = parseaddr(ccList[i])
    cc = mailTuple[0]
    "name"+str(i) = cc
    ....
</code></pre>

<p>Of course, this does not work. Thanks!</p>

<p><strong>Update</strong></p>

<p>Thanks to everyone with great answers! I think this list solution by <a href="http://stackoverflow.com/questions/4320163/how-do-i-assign-incremental-names-to-elements-of-a-list/4320268#4320268">Thomas K</a> will work in this case; except that I could not solve how to print if cc recipients are other than 3: </p>

<pre><code>&gt;&gt;&gt; ccNames = []

&gt;&gt;&gt; for i in range(len(ccList)):
    mailTuple = parseaddr(ccList[i])
    cc = mailTuple[0]
    ccNames.append(cc)

&gt;&gt;&gt; "sender attached %s ccs which are %s, %s, and %s" % (len(ccNames), ccNames[0], ccNames[1], ccNames[2])
'sender attached 3 ccs which are az, cc777, and user11'
&gt;&gt;&gt;
</code></pre>

<p>So how do I fix the code so that if there are other than 3 ccs, it still prints all cc recipients?</p>
