[Tutor] high score lists

D. Hartley denise.hartley at gmail.com
Fri Apr 15 23:51:46 CEST 2005

Thanks, I'll look at the cookbook! I didnt know it was available online.

I did look at your example about using the longest number, but I
couldnt really understand all of the code, and ended up deciding to
arrange it so that the two columns were left-aligned: it looked like
it would align them down the center in your example? Let me know if I
am misunderstanding something.

Re: the key discussion: that was very helpful, thank you! So if I had
a list of tuples, and I wanted to use the "key" function to arrange
the list of tuples by the second tuple item, I would define a function
that returns the second tuple item, and then do key=find_second()? or
could i just do key=[1]? since i'm sorting tuples by a part of a
tuple, it gets more confusing than when I was sorting simple lists.


More information about the Tutor mailing list