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
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: Posting to comp.lang.python is pair programming with the entire > 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 internet ;-) -- 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.
| ||||||||||||||