[Tutor] understanding join
kent37 at tds.net
Thu Jul 31 02:03:32 CEST 2008
> On 31/07/2008, Steve Poe <steve.poe at gmail.com> wrote:
>> Okay, I can see the order of the join is the same as mine, but
>> the join still seems to be out of sequence. I am thinking it should be
>> 'abcABC' or 'ABCabc' not at the beginning, middle, and end of the
>> original string. At least, I am trying to wrap my head around its
Does this look useful?
In : people = [ 'Tom', 'Dick', 'Harry' ]
In : ', '.join(people)
Out: 'Tom, Dick, Harry'
Your confusion is in thinking about the string 'ABC' as a single
entity. For the purposes of join(), it is a sequence of three letters.
The argument to join() is a sequence of strings, not a single string.
More information about the Tutor