On 25 Maj, 08:56, Rares Vernica <[EMAIL PROTECTED]> wrote: > use a set to store them: > > >>> s=set() > >>> s.add('a') > >>> s.add('b') > >>> s > set(['a', 'b']) > >>> s.add('a') > >>> s > set(['a', 'b']) > >>> s.add('c') > >>> s > > set(['a', 'c', 'b']) > > > > it does remove duplicates, but is it not ordered. to order it you can > use: > > >>> l=list(s) > >>> l.sort() > >>> l > > ['a', 'b', 'c'] > > hth, > Rares
sets dont seem to be so good because there is no way to iterate them. s.pop() remove and return an arbitrary element from s; raises KeyError if empty i dont want to remove i just want to get the string that is stored there. -- http://mail.python.org/mailman/listinfo/python-list