clp2 at rebertia.com
Thu Feb 19 23:11:48 CET 2009
On Thu, Feb 19, 2009 at 2:07 PM, Gary Wood <woodygar at sky.com> wrote:
> I'm stuck on a tutorial Hands on Python3
> Exercise 220.127.116.11. ** Complete the following function. This starting code is
> in joinAllStub.py. Save it to the new name joinAll.py. Note the way an
> example is given in the documentation string. It simulates the use of the
> function in the Shell. This is a common convention:
> import string
> '''exercise to complete and test this function'''
> def joinStrings(sentance):
> '''Join all the strings in stringList into one string,
> and return the result. For example:
> >>> print joinStrings(['very', 'hot', 'day'])
> # finish the code for this function
> # i tried this but not sure whats mising
> for i in sentance:
You're not supposed to output the strings, you've supposed to combine
them and return the single combined string (it's nearly identical to
how you summed the numbers). The printing is done by the calls to
print() outside of this function.
Follow the path of the Iguana...
More information about the Python-list