How to append to the end of an empty list?
<p>I have a list:</p>

<pre><code>list1=[]
</code></pre>

<p>the length of the list is undetermined so I am trying to append objects to the end of list1 like such:</p>

<pre><code>for i in range(0, n):

    list1=list1.append([i])
</code></pre>

<p>But my output keeps giving this error: AttributeError: 'NoneType' object has no attribute 'append'</p>

<p>Is this because list1 starts off as an empty list? How do I fix this error?</p>
