Stringify a list

Charlie Clark charlie at begeistert.org
Wed May 16 12:00:04 CEST 2001


> 	[2, 6, 'A', 8, 'J']
>
> I don't mind the commas, but how do I remove the quotes and brackets
> without going through contortions?
"A" is the representation of a value. A would be a variable. While you
can convert the list to a string str(list) this doesn't help you.

Try this:
text = ""

for item in list:
..     text = text + " " + str(item) # add commas if you wish

print text


Charlie



More information about the Python-list mailing list