Re: thanks very much indeed for your help is there a better way to do this (python3) newby

2009-02-24 Thread kshitij
On Feb 24, 6:29 am, "Rhodri James" 
wrote:
> On Mon, 23 Feb 2009 23:33:31 -, Gary Wood  wrote:
> > '''exercise to complete and test this function'''
> > import string
> > def joinStrings(items):
> >     '''Join all the strings in stringList into one string,
> >     and return the result. For example:
> >     >>> print joinStrings(['very', 'hot', 'day'])
> >     'veryhotday'
> >     '''
> >     for i in items:
> >        return (''.join(items))
>
> As I'm sure your teacher will point out, this is sub-optimal :-)
> That for-loop isn't doing anything, because you always return
> out of it at the first iteration.
>
> I suspect that you're expected to concatenate the strings
> together by hand and return the resulting string once you've
> done them all.  Trying writing it that way.
>
> PS: it helps a lot if what you say in the doc string matches
> what you write in the rest of the code.  In this case you
> call your input string "items", but then say "Join all the
> strings in *stringList*..."
>
> --
> Rhodri James *-* Wildebeeste Herder to the Masses

Here is another way of doing this:

print ('very' + 'hot' + 'day')

Hope this helps.
--
http://mail.python.org/mailman/listinfo/python-list


Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-21 Thread kshitij
On Mar 21, 2:17 am, Esmail  wrote:
> Terry Reedy wrote:
>
> > Ditto, with T-bird. Just add a newsgroup account with news.gmane.org or
> > snews.gmane.org (for ssl) as the server and set the rest as you please.
>
> > gmane.comp.python.general is a mirror of python-list, from python.org,
> > with its spam filtering that exclude most of the crap from gmail and
> > g-groups.  gmane mirrors 1000s of other technical mailing lists,
> > including about 200 under g.c.python.  I think its downtime is under 1%
> > and never terribly long that I have noticed in several years.
>
> Thanks Terry, I appreciate all the help and info.
>
> Esmail

Google Groups is sort of neat.
--
http://mail.python.org/mailman/listinfo/python-list