Case-Insensitive Sorting of Multi-Dimensional Lists

Joe joe at incomps.com
Fri Jun 8 12:04:21 EDT 2007


> Try:
> 
> list.sort(key=lambda el: el[0].lower())

Now, I would like to be able to specify which index to sort by.  I am not
able to pass in external variables like:

List.sort(key=lambda el: el[indexNumber].lower())

I am new to lambda and have searched for a few hours this morning, coming up
empty handed.  Is this possible?

Thanks!

Jough




More information about the Python-list mailing list