Bill Campbell wrote: > The way I usually do this is something like: > > outDict = dict(map(lambda x: (x, 1), inList)) > names = outDict.keys() > names.sort()
This is a really old approach. Since Python 2.3 you can say outDict = dict.fromkeys(inList) or dict.fromkeys(inList, 1) if you cared about the value. Since Python 2.4 you can use a set instead of a dict as shown in other replies. Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
