Seems like a lot of extra work for joining the strings. You should only
need:

''.join(['very', 'hot', 'day']) (no spaces)
' '.join(['very', 'hot', 'day']) (if you want spaces)

glen


On Wed, May 30, 2012 at 11:21 AM, Akeria Timothy <akeriatimo...@gmail.com>wrote:

> Hello all,
>
> I am working on learning Python(on my own) and ran into an exercise that I
> figured out but I wanted to know if there was a different way to write the
> code? I know he wanted a different answer for the body because we haven't
> gotten to the ' '.join() command yet.
>
> This is what I have:
>
> def joinStrings(stringList):
>  string = []
>     for string in stringList:
>         print ''.join(stringList)
>
>
> def main():
>     print joinStrings(['very', 'hot', 'day'])
>     print joinStrings(['this', 'is', 'it'])
>     print joinStrings(['1', '2', '3', '4', '5'])
>
> main()
>
>
> thanks all
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to