get rid of duplicate elements in list without set

Alexzive zasaconsulting at gmail.com
Fri Mar 20 15:16:40 CET 2009


Hello there,

I'd like to get the same result of set() but getting an indexable
object.
How to get this in an efficient way?

Example using set

A = [1, 2, 2 ,2 , 3 ,4]
B= set(A)
B = ([1, 2, 3, 4])

 B[2]
TypeError: unindexable object

Many thanks, alex



More information about the Python-list mailing list