Re: A simple list question.

2005-12-22 Thread Tomasz Lisowski
KraftDiner wrote: > I am trying to implement a two dimensional array. > mylist = [[a,b,c],[d,e,f,c],[g,h,i]] > > So the array is of length 3 here... > So how do I initialize this array and then set each object? > At some point in my code I know there will be 3 lists in the list. > So how do I init

Re: A simple list question.

2005-12-22 Thread Kent Johnson
KraftDiner wrote: > I am trying to implement a two dimensional array. > mylist = [[a,b,c],[d,e,f,c],[g,h,i]] > > So the array is of length 3 here... > So how do I initialize this array and then set each object? > At some point in my code I know there will be 3 lists in the list. > So how do I init

Re: A simple list question.

2005-12-22 Thread KraftDiner
I am trying to implement a two dimensional array. mylist = [[a,b,c],[d,e,f,c],[g,h,i]] So the array is of length 3 here... So how do I initialize this array and then set each object? At some point in my code I know there will be 3 lists in the list. So how do I initialize this list such that I can

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22/12/05, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: On 22 Dec 2005 10:14:10 -0800, KraftDiner < [EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfObjects.append(self.cur

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22 Dec 2005 10:14:10 -0800, KraftDiner <[EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfObjects.append(self.currentObject)elif:  

Re: A simple list question.

2005-12-22 Thread Larry Bates
KraftDiner wrote: > Is there a cleaner way to implement this code? > > if len(self.listOfObjects) == 0: > self.listOfObjects.append(self.currentObject) > elif: > self.listOfObjects[self.currentS

A simple list question.

2005-12-22 Thread KraftDiner
Is there a cleaner way to implement this code? if len(self.listOfObjects) == 0: self.listOfObjects.append(self.currentObject) elif: self.listOfObjects[self.currentSlice] = self.currentO