Re: [Tutor] remove instances from a list

2007-09-17 Thread Alan Gauld
"Ara Kooser" <[EMAIL PROTECTED]> wrote > Is the translation for the above line of code into pseudocode? > yeast for every yeast in the list yeasts if the yeast method > returned isAlive() Others have given you the solution. But note that you still have the terminology wrong. "... the yeast meth

Re: [Tutor] remove instances from a list

2007-09-16 Thread Ian Witham
On 9/17/07, Ara Kooser <[EMAIL PROTECTED]> wrote: > > Hello all, > >On my continuing quest to grapple with OO programming Kent showed > me that I could call instances and store them in a list like: > yeasts = > [Yeast("Red_1","Red","ade","lys"),Yeast("Yellow_1","Yellow","lys","ade"), > >

Re: [Tutor] remove instances from a list

2007-09-16 Thread Kent Johnson
Ara Kooser wrote: > Hello all, > >On my continuing quest to grapple with OO programming Kent showed > me that I could call instances and store them in a list like: > yeasts = > [Yeast("Red_1","Red","ade","lys"),Yeast("Yellow_1","Yellow","lys","ade"), > > Yeast("Red_2","Red","ade","

Re: [Tutor] remove instances from a list

2007-09-16 Thread John Fouhy
On 17/09/2007, Ara Kooser <[EMAIL PROTECTED]> wrote: > Give certain conditions I want the yeast cell to die. Kent suggested I > use something this: > yeasts = [yeast for yeast in yeasts if yeast.isAlive()] to clear out > dead yeast. [...] > class Yeast: [...] > def isAlive(self): > if