Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion function that accepts any amount of arguments?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nick Craig-Wood  
View profile  
 More options Apr 25 2008, 8:30 am
Newsgroups: comp.lang.python
From: Nick Craig-Wood <n...@craig-wood.com>
Date: Fri, 25 Apr 2008 07:30:03 -0500
Local: Fri, Apr 25 2008 8:30 am
Subject: Re: function that accepts any amount of arguments?

Steve Holden <st...@holdenweb.com> wrote:
>  Ken wrote:
> > "Steve Holden" <st...@holdenweb.com> wrote in message
>  [...]
> >> def mean(*x):
> >>     total = 0.0
> >>     for v in x:
> >>         total += v
> >>     return v/len(x)

> >  think you want total/len(x) in return statement

>  Yes indeed, how glad I am I wrote "untested". I clearly wasn't pair
>  programming when I wrote this post ;-)

Posting to comp.lang.python is pair programming with the entire
internet ;-)

--
Nick Craig-Wood <n...@craig-wood.com> -- http://www.craig-wood.com/nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.