On Mon, 17 Nov 2008 14:36:03 -0500, Terry Reedy wrote:
> [EMAIL PROTECTED] wrote:
>> Chris Rebert:
>>> You use the `key` argument to .sort(): L2.sort(key=lambda item:
>>> item[1])
>>
>> I like the lambda because it's a very readable solution that doesn't
>> require the std lib and it doesn't forc
[EMAIL PROTECTED] wrote:
Chris Rebert:
You use the `key` argument to .sort():
L2.sort(key=lambda item: item[1])
I like the lambda because it's a very readable solution that doesn't
require the std lib and it doesn't force the programmer (and the
person that reads the code) to learn yet another
Chris Rebert:
> You use the `key` argument to .sort():
> L2.sort(key=lambda item: item[1])
I like the lambda because it's a very readable solution that doesn't
require the std lib and it doesn't force the programmer (and the
person that reads the code) to learn yet another thing/function.
But I c
On Nov 17, 8:56 pm, asc <[EMAIL PROTECTED]> wrote:
> But my problem is this. I have a list, that contains a number of
> embeded lists;
> e.g. L2 = [['something', 'bb'], ['somethingElse', 'cc'],
> ['anotherThing', 'aa']]
> Now I want to sort this list by the second item of each sublist. So
> the ou
On Mon, Nov 17, 2008 at 1:56 AM, asc <[EMAIL PROTECTED]> wrote:
> Hi all,
> I have a problem and I'm not sure whether sort() can help me.
> I understand that if I have a list; say L = ['b', 'c', 'a']
> I can use L.sort() and I will then have; L = ['a', 'b', 'c']
>
> But my problem is this. I have a