[Tutor] (no subject)

Max Jameson max.jameson at sbcglobal.net
Fri Jan 19 18:26:02 CET 2007


I know this is totally off-the-wall, but what am I doing wrong here?  I am using Python 2.5, and I am just learning...please be kind!


>>> aList = [2,3]
>>> bList = [5,7,9]
>>> aList.append(bList)
>>> print aList
[2, 3, [5, 7, 9]]
>>> print aList [1] [2]
Traceback (most recent call last):
  File "<pyshell#40>", line 1, in <module>
    print aList [1] [2]
TypeError: 'int' object is unsubscriptable
>>> print aList [0] [1]
Traceback (most recent call last):
  File "<pyshell#41>", line 1, in <module>
    print aList [0] [1]
TypeError: 'int' object is unsubscriptable
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070119/31468966/attachment.htm 


More information about the Tutor mailing list