the declaration is wrong <div><br></div><div>if you want to create a two dimensional array try to use functions like arange and reshape <br><br><div class="gmail_quote">On Mon, Oct 11, 2010 at 9:54 PM, Fasihul Kabir <span dir="ltr"><<a href="mailto:rrockz09@yahoo.com">rrockz09@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div><span style="color:rgb(0, 0, 191)">a = [0]*5</span><br style="color:rgb(0, 0, 191)">
<span style="color:rgb(0, 0, 191)"> for i in range(0, 4):</span><br style="color:rgb(0, 0, 191)"><span style="color:rgb(0, 0, 191)">    for j in range(0, i):</span><br style="color:rgb(0, 0, 191)"><span style="color:rgb(0, 0, 191)">        a[i].append(j)</span><br>
<br>why the above codes show the following error. and how to overcome it.<br><br><span style="color:rgb(255, 0, 0)">Traceback (most recent call last):</span><br style="color:rgb(255, 0, 0)"><span style="color:rgb(255, 0, 0)">  File "<pyshell#10>", line 3, in <module></span><br style="color:rgb(255, 0, 0)">
<span style="color:rgb(255, 0, 0)">   
 a[i].append(j)</span><br style="color:rgb(255, 0, 0)"><span style="color:rgb(255, 0, 0)">AttributeError: 'int' object has no attribute 'append'</span><br></div>
</div><br>

      </div><br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Nitin Pawar<br><br>
</div>