Substitute for join()

Daniel Klein DanielK at jBASE.com
Wed Mar 21 14:35:53 EST 2001


I've got to make a script (written in version 2.0) to work on a machine
running 1.5.2. The only incompatible line is one that uses the
"".join(mylist) method. To 'get out of the woods' quickly, I substituted it
with

s = ''
for element in mylist: s = s + element

Is this the most efficient way to code this?

Thanks,
Daniel Klein





More information about the Python-list mailing list