difference in operation of string.join and ''.join

Emile van Sebille emile at fenx.com
Sun Oct 21 18:51:08 EDT 2001


You need to designate what to join with:

string.join([x+y for x, y in zip('test', 'dust')],'')

--

Emile van Sebille
emile at fenx.com

---------
"John Thingstad" <john.thingstad at chello.no> wrote in message
news:mailman.1003694549.26203.python-list at python.org...
>
> >>> ''.join([x+y for x, y in zip('test', 'dust')])
> 'tdeusstt'
> >>> import string
> >>> string.join([x+y for x, y in zip('test', 'dust')])
> 'td eu ss tt'
>
> What is this?
>
>




More information about the Python-list mailing list