Hi,

I have a bunch of lists within lists that I need to sort ref item [4], I can't 
access my code at the moment but I basically ...

a = [[...], [...], .... ]
a.sort(item4)

def item4(a,b):
        return a[4], b[4]


Having googled I think there is a better way of doing this with the key 
attribute

a.sort(key= ?? )

I cant get a handle on how key works or how to code it for my needs.

Can anyone help ?

Thanks in advance

Dave
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to