string copy of a list

Brian Quinlan brian at sweetapp.com
Sun Apr 15 18:02:21 EDT 2001


I have no idea what you are asking for. So here is some random code:

>>> a = ['Hello', 'How', 'Are', 'You?']
>>> ''.join(a)
'HelloHowAreYou?'
>>> ','.join(a)
'Hello,How,Are,You?'
>>> ' '.join(a)
'Hello How Are You?'
>>> a[0]
'Hello'
>>> a[1]
'How'

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Jim Richardson
Sent: Sunday, April 15, 2001 3:01 PM
To: python-list at python.org
Subject: string copy of a list


I am stumped, str(listname) returns a string of list, but includes the
commas
and [] that the list would show if printed. I want a string copy of a list,
is
there a simple way I have missed? please? thanks

--
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.

--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list