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
>
> >
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
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
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
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
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
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
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
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
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
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
11 matches
Mail list logo