2D List
Nitin Pawar
nitinpawar432 at gmail.com
Mon Oct 11 12:34:57 EDT 2010
the declaration is wrong
if you want to create a two dimensional array try to use functions like
arange and reshape
On Mon, Oct 11, 2010 at 9:54 PM, Fasihul Kabir <rrockz09 at yahoo.com> wrote:
> a = [0]*5
> for i in range(0, 4):
> for j in range(0, i):
> a[i].append(j)
>
> why the above codes show the following error. and how to overcome it.
>
> Traceback (most recent call last):
> File "<pyshell#10>", line 3, in <module>
> a[i].append(j)
> AttributeError: 'int' object has no attribute 'append'
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
Nitin Pawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101011/b83ca269/attachment-0001.html>
More information about the Python-list
mailing list