[Tutor] understanding join
Steve Poe
steve.poe at gmail.com
Thu Jul 31 04:23:31 CEST 2008
> Does this look useful?
>
> In [3]: people = [ 'Tom', 'Dick', 'Harry' ]
>
> In [4]: ', '.join(people)
> Out[4]: '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.
>
> Kent
Kent,
Your explanation about my confusion is right on target. Thank you!
Okay, now let's join people to people and what do we get?
Steve
More information about the Tutor
mailing list