[Tutor] Sort a list following the order of other list

jfouhy@paradise.net.nz jfouhy at paradise.net.nz
Tue Aug 23 05:26:26 CEST 2005


Quoting Jonas Melian <jonasmg at SoftHome.net>:

> Thank you very much!.
> 
> I didn't want to make it using the old-style programming because it's 
> more large and I'm supposed that slower that using a list comprehension
> solution.

Well, we can investigate, to find out the truth :-)

Hopefully you can read the attached file.  Here are my results:
$ python sorttest.py
John 1:[5.324422796752101, 6.9189729420918029, 6.771758421810592]
John 2:[3.4790142322557749, 3.4373198269612502, 3.392254322825945]
Kent:[29.745739472474856, 42.376246143015386, 38.031272689685423]

(each time represents 100,000 reps)

-- 
John.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sorttest.py
Type: text/x-python
Size: 0 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20050823/09be7409/sorttest.py


More information about the Tutor mailing list