[Tutor] Using join instead of string.joinfield
3dbernard at gmail.com
Tue Aug 23 17:12:00 CEST 2005
Oh. Thanks a lot for that, now that you told me, the doc about join
makes lot more sense!
On 8/23/05, Harper, Gina <gharper at medplus.com> wrote:
> Suppose you want to join a list of words with hyphens.
> >>> a_list = ['this', 'is', 'a', 'list', 'of', 'words']
> >>> sep_char = '-'
> >>> print sep_char.join(a_list)
> -----Original Message-----
> From: Bernard Lebel [mailto:3dbernard at gmail.com]
> Sent: Tuesday, August 23, 2005 11:04 AM
> To: Python Tutor list
> Subject: [Tutor] Using join instead of string.joinfield
> The documentation says that the built-in join method now replaces the
> string.joinfield function. However how do you achieve the same
> operation? The join method accepts only one argument, that is, the list
> of strings to join. How do you then specify the separating character?
> Tutor maillist - Tutor at python.org
More information about the Tutor