newbie question: convert a list to one string

martijn at gamecreators.nl martijn at gamecreators.nl
Thu Aug 25 04:48:19 EDT 2005


H!

I'm searching for the fastest way to convert a list to one big string.

For example:
test = ['test','test2','test3']

print unlist(test)
> test test2 test3 (string)


I know I can make a loop like below but is that the fastest/best option
?

def unlist(test):
output=''
for v in test:
    output = output+" "+v
return output


Thanks for helping,
GC-Martijn




More information about the Python-list mailing list