Assigning a value to Python list doesn't work?
<p>The following code works properly for me:</p>

<pre><code># -*- coding: utf-8 -*-
N = int(raw_input("N="))
l=[]
i = 0
while i&lt;N:
   n = raw_input("e"+str(i)+"=")
   l.append(n) 
   i = i+1   
print l  
</code></pre>

<p><strong>But</strong>, why can't I simplify it by using <code>l[i] = raw_input("e"+str(i)+"=")</code> instead?</p>

<p>Example: (doesn't work)</p>

<pre><code># -*- coding: utf-8 -*-
N = int(raw_input("N="))
l=[]
i = 0
while i&lt;N:
   l[i] = raw_input("e"+str(i)+"=")
   i = i+1   
print l 
</code></pre>
