On 31/07/2008, Steve Poe <[EMAIL PROTECTED]> wrote:
>  Your explanation is very help. It does make be wonder the usefulness
>  of join with strings. Do you have a practical example/situation?

Kent's example is common: you might have a list of strings that you
want to display to the user, so you call ', '.join() on the list.
Calling ''.join() is the standard way in Python to concatenate a bunch
of strings.  If you've got some two-dimensional data structure that
you want to convert to CSV, you could use the csv module, but if your
data is simple, it might be easier to just do: '\n'.join(','.join(row)
for row in data)

I guess it depends what kind of programming you're doing, but in my
experience, .join() is definitely a useful function.

-- 
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to