list Integer indexing dies??
Batista, Facundo
FBatista at uniFON.com.ar
Thu Dec 23 09:17:57 EST 2004
More information about the Python-list mailing list
Thu Dec 23 09:17:57 EST 2004
- Previous message (by thread): list Integer indexing dies??
- Next message (by thread): list Integer indexing dies??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Ishwor] #- Now why doesnt this list which holds integer seem to work?? #- #- >>> l = [1,2,3] #- >>> l[0] #- 1 #- >>> l[0][0] #- #- Traceback (most recent call last): #- File "<pyshell#244>", line 1, in -toplevel- #- l[0][0] #- TypeError: unsubscriptable object #- >>> l[0] #- 1 #- >>> 1[0] #- #- Traceback (most recent call last): #- File "<pyshell#246>", line 1, in -toplevel- #- 1[0] #- TypeError: unsubscriptable object #- >>> Well, because the integer is not a subscriptable object.... IOW, the string is a sequence of characters, and the integer is not sequence at all. >>> 'a'[0] 'a' >>> 'ab'[0] 'a' >>> 'ab'[1] 'b' What behaviour did you expect when subscripting an integer? . Facundo Bitácora De Vuelo: http://www.taniquetil.com.ar/plog PyAr - Python Argentina: http://pyar.decode.com.ar/ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ADVERTENCIA. La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley. Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada. Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje. Muchas Gracias. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20041223/9fe5faf2/attachment.html>
- Previous message (by thread): list Integer indexing dies??
- Next message (by thread): list Integer indexing dies??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list