How to sort a list of strings on a substring

alex23 wuwei23 at gmail.com
Tue Oct 6 06:34:02 CEST 2009


Steven D'Aprano <ste... at REMOVE.THIS.cybersource.com.au> wrote:
> Oh please. That's a ridiculous excuse. Your post started with "Here you
> are" -- the implication is that you thought it *was* a solution, not a
> hint. A hint would be something like "Write a key function, perhaps using
> lambda, and pass it to the sort() method using the key parameter."

In n00m's defense, the OP's question was "I'm just not getting how to
use an element of a string as a "key" within a list of strings", which
n00m's post did answer, and which did work with the data set given. If
Scott had asked "could someone show me how to do this", then yes, the
"here you are" would have been wrong.

Ah, semantics and the lack of expression in text :)



More information about the Python-list mailing list