lists - append - unique and sorted
Delaney, Timothy (Tim)
tdelaney at avaya.com
Thu Jun 7 18:17:47 EDT 2007
Terry Reedy wrote:
> "Dan Bishop" <danb_83 at yahoo.com> wrote in message
> news:1181181710.879767.234090 at m36g2000hse.googlegroups.com...
>> If you don't need the list to be sorted until you're done building
>> it, you can just use:
>>
>> lst = sorted(set(lst))
>
> ?? looks same as
> lst.sort()
You missed that the OP wants only unique values from the original list.
Tim Delaney
More information about the Python-list
mailing list