Title: RE: Best way to make a list unique?

[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/

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to