Re: can some one help me with my code. thanks

2012-01-23 Thread Tamanna Sultana
On Jan 20, 9:23 pm, Steven D'Aprano wrote: > On Fri, 20 Jan 2012 16:21:30 -0800, Rick Johnson wrote: > > On Jan 20, 12:49 pm, Tamanna Sultana wrote: > >> > If you can give me some lead to fix the code I wrote below that will > >> > be great: > > > Your variable names need a bit more thought > > >

Re: can some one help me with my code. thanks

2012-01-23 Thread Tamanna Sultana
On Jan 20, 11:03 pm, Chris Angelico wrote: > On Sat, Jan 21, 2012 at 1:23 PM, Steven D'Aprano > > wrote: > > On Fri, 20 Jan 2012 16:21:30 -0800, Rick Johnson wrote: > >> Your variable names need a bit more thought > > >>> def average(bin): > > >> What is a "bin"? Maybe you shoulc have called this

Re: can some one help me with my code. thanks

2012-01-22 Thread Vincent Vande Vyvre
Le 20/01/12 20:30, Vincent Vande Vyvre a écrit : Le 20/01/12 19:49, Tamanna Sultana a écrit : can some one help me?? I would like to create a function that, given a bin, which is a list (example below), generates averages for t

Re: can some one help me with my code. thanks

2012-01-20 Thread Chris Angelico
On Sat, Jan 21, 2012 at 1:23 PM, Steven D'Aprano wrote: > On Fri, 20 Jan 2012 16:21:30 -0800, Rick Johnson wrote: >> Your variable names need a bit more thought >> >>> def average(bin): >> >> What is a "bin"? Maybe you shoulc have called this a "lst" eh? > > "Bin" is a standard English world. You

Re: can some one help me with my code. thanks

2012-01-20 Thread Steven D'Aprano
On Fri, 20 Jan 2012 16:21:30 -0800, Rick Johnson wrote: > On Jan 20, 12:49 pm, Tamanna Sultana wrote: >> > If you can give me some lead to fix the code I wrote below that will >> > be great: > > Your variable names need a bit more thought > >> def average(bin): > > What is a "bin"? Maybe you s

Re: can some one help me with my code. thanks

2012-01-20 Thread Jon Clements
On Jan 20, 9:26 pm, Terry Reedy wrote: > On 1/20/2012 2:46 PM, Terry Reedy wrote: > > > > > > > > > > > On 1/20/2012 1:49 PM, Tamanna Sultana wrote: > > >> can some one help me?? > >>> I would like to create a function that, given a bin, which is a list > >>> (example below), generates averages fo

Re: can some one help me with my code. thanks

2012-01-20 Thread Rick Johnson
On Jan 20, 12:49 pm, Tamanna Sultana wrote: > > If you can give me some lead to fix the code I wrote below that will be > > great: Your variable names need a bit more thought > def average(bin): What is a "bin"? Maybe you shoulc have called this a "lst" eh? >     num=[] Why would you call a l

Re: can some one help me with my code. thanks

2012-01-20 Thread Terry Reedy
On 1/20/2012 2:46 PM, Terry Reedy wrote: On 1/20/2012 1:49 PM, Tamanna Sultana wrote: can some one help me?? I would like to create a function that, given a bin, which is a list (example below), generates averages for the numbers separated by a string 'end'. I am expecting to have 4 averages f

Re: can some one help me with my code. thanks

2012-01-20 Thread Tim Chase
On 01/20/12 13:46, Terry Reedy wrote: def average(bin): num=[] total = 0.0 count=0 for number in bin: if number!='end': total += float(number) count+=1 else: num.append(total/count) total = 0.0

Re: can some one help me with my code. thanks

2012-01-20 Thread Terry Reedy
On 1/20/2012 1:49 PM, Tamanna Sultana wrote: can some one help me?? I would like to create a function that, given a bin, which is a list (example below), generates averages for the numbers separated by a string 'end'. I am expecting to have 4 averages from the above bin, since there are 4 sets

Re: can some one help me with my code. thanks

2012-01-20 Thread Vincent Vande Vyvre
Le 20/01/12 19:49, Tamanna Sultana a écrit : can some one help me?? I would like to create a function that, given a bin, which is a list (example below), generates averages for the numbers separated by a string 'end'. I am expecting to have 4 averages from th