Best way to make a list unique?
Batista, Facundo
FBatista at uniFON.com.ar
Tue Mar 8 08:02:43 EST 2005
More information about the Python-list mailing list
Tue Mar 8 08:02:43 EST 2005
- Previous message (by thread): Best way to make a list unique?
- Next message (by thread): Best way to make a list unique?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Max M] #- >>> la = [1,2,3,4,3,2,3,4,5] #- >>> from sets import Set #- >>> sa = Set(la) #- >>> for itm in sa: #- ... print itm Remember that in Python 2.4 you have ´´set´´ as a built-in data type: >>> la = [1,2,3,4,3,2,3,4,5] >>> sa = set(la) >>> for it in sa: print it 1 2 3 4 5 . Facundo Bitácora De Vuelo: http://www.taniquetil.com.ar/plog PyAr - Python Argentina: http://pyar.decode.com.ar/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20050308/59ec6418/attachment.html>
- Previous message (by thread): Best way to make a list unique?
- Next message (by thread): Best way to make a list unique?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list