Re: [Tutor] Removing duplicates in a list with a fixed length of items in the list.

2007-01-11 Thread Klaus Ramelow
Why not sorting the items and throw out all multiples until you reach the fixed length ? Klaus Ramelow ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Removing duplicates in a list with a fixed length of items in the list.

2007-01-11 Thread Kent Johnson
Adam Cripps wrote: > I've not worked with Sets before but will give it a go. Is there a way > of turning the Set back to a list? list(mySet) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Removing duplicates in a list with a fixed length of items in the list.

2007-01-11 Thread Adam Cripps
On 1/11/07, Adam Cripps <[EMAIL PROTECTED]> wrote: > On 1/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Adam Cripps wrote: > > > I have a list which comprises of simple random arithmetic problems for > > > teachers to give to their pupils. This list must be a set length (if > > > the teacher a

Re: [Tutor] Removing duplicates in a list with a fixed length of items in the list.

2007-01-11 Thread Kent Johnson
Adam Cripps wrote: > I have a list which comprises of simple random arithmetic problems for > teachers to give to their pupils. This list must be a set length (if > the teacher asks for 10 questions, they should get 10 questions), but > should not have any duplicates. > > I've seen the use of sets

[Tutor] Removing duplicates in a list with a fixed length of items in the list.

2007-01-11 Thread Adam Cripps
I have a list which comprises of simple random arithmetic problems for teachers to give to their pupils. This list must be a set length (if the teacher asks for 10 questions, they should get 10 questions), but should not have any duplicates. I've seen the use of sets, but this reduces the size of