Re: [Tutor] Sorting list of tuples in two passes

2011-08-29 Thread Dayo Adewunmi
On 08/29/2011 01:59 AM, Hugo Arts wrote: On Mon, Aug 29, 2011 at 2:19 AM, Dayo Adewunmi wrote: On 08/28/2011 06:23 PM, Hugo Arts wrote: On Sun, Aug 28, 2011 at 6:43 PM, Dayo Adewunmi wrote: Hi I have a list of tuples that each have four elements: [(firstName,lastName,userName,gidNumber),(

Re: [Tutor] Sorting list of tuples in two passes

2011-08-28 Thread Hugo Arts
On Mon, Aug 29, 2011 at 2:19 AM, Dayo Adewunmi wrote: > On 08/28/2011 06:23 PM, Hugo Arts wrote: >> >> On Sun, Aug 28, 2011 at 6:43 PM, Dayo Adewunmi >>  wrote: >>> >>> Hi >>> >>> I have a list of tuples that each have four elements: >>> >>> [(firstName,lastName,userName,gidNumber),(.)] >>

Re: [Tutor] Sorting list of tuples in two passes

2011-08-28 Thread Steven D'Aprano
Dayo Adewunmi wrote: It works when I use your example, but I don't understand why it won't work when I use 4-element tuples instead of 2: What makes you say it doesn't work? It looks like it works to me: >>>l = [('wascas','aaa','fdvdfv', 1), ('rtgdsf','bbb','trfg', 1), ('addwe','ccc','esd',

Re: [Tutor] Sorting list of tuples in two passes

2011-08-28 Thread Dayo Adewunmi
On 08/28/2011 06:23 PM, Hugo Arts wrote: On Sun, Aug 28, 2011 at 6:43 PM, Dayo Adewunmi wrote: Hi I have a list of tuples that each have four elements: [(firstName,lastName,userName,gidNumber),(.)] I'm trying to sort this list in two passes. First by gidNumber and then the subgroups

Re: [Tutor] Sorting list of tuples in two passes

2011-08-28 Thread Hugo Arts
On Sun, Aug 28, 2011 at 6:43 PM, Dayo Adewunmi wrote: > Hi > > I have a list of tuples that each have four elements: > > [(firstName,lastName,userName,gidNumber),(.)] > > I'm trying to sort this list in two passes. First by gidNumber and then the > subgroups by lastName. So far i've only b

[Tutor] Sorting list of tuples in two passes

2011-08-28 Thread Dayo Adewunmi
Hi I have a list of tuples that each have four elements: [(firstName,lastName,userName,gidNumber),(.)] I'm trying to sort this list in two passes. First by gidNumber and then the subgroups by lastName. So far i've only been able to sort by gidNumber. But I can't seem to wrap my mind a