Sobre listas

Chema Cortés py en ch3m4.org
Jue Oct 21 15:01:47 CEST 2004


On Thursday 21 October 2004 14:41, Batista, Facundo wrote:

> Bueno, tampoco hace falta una variable temporal:

Y si nos ponemos críticos, es que no hace falta ni el .reverse

>>> lst = [1,2,3,4,5,6,7,8,9]
>>> lst = lst[3:][::-1]
>>> lst
[9, 8, 7, 6, 5, 4]

Más abreviado:
>>> lst = lst[:2:-1]
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: no disponible
Type: application/pgp-signature
Size: 189 bytes
Desc: no disponible
URL: <http://mail.python.org/pipermail/python-es/attachments/20041021/b9f6c20b/attachment.pgp>
------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es


Más información sobre la lista de distribución Python-es