"Roelof Wobben" <[email protected]> wrote
> Carefully read the documentation for str.join:
> http://docs.python.org/library/stdtypes.html#str.join
>
>How does it work, what does it return, etc. Then fix the
>corresponding line in your code.
str.join(iterable)ΒΆ
It puts all the elements of iterable into one string named str.
Thats not what the documentation says...
So it returns a string.
Thats true.,
When trying to understand how a function works, or debug these kinds
of
errors use the >>> prompt to experiment. It's the definitive way of
seeing what
Python will do.
For example try:
"123".join([5,6,7])
Can you see what Python has done?
Use the >>> prompt it is one of the most powerful tools you have.
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor