[Tutor] Grouping based on attributes of elements in a List
sander.sweers at gmail.com
Wed Mar 30 00:52:54 CEST 2011
On 30 March 2011 00:30, Alan Gauld <alan.gauld at btinternet.com> wrote:
> Wouldn't you just return a tuple of the two elements?
> Or am I missing something having jumped into the middle of the thread...
Ah yes, you are correct. But imo reading "key=lambda l: (l, l,
l)" (which would be needed to sort how the OP wanted) hurts my eyes
;-). Anyway, both options will work fine for the OP.
More information about the Tutor