[Tutor] Converting a list to a string

Praveen Pathiyil ppathiyi@cisco.com
Mon, 7 May 2001 16:23:13 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_012D_01C0D712.038317C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

If i have a list=20
status =3D ['tftp>', 'Sent', '1943', 'bytes', 'in', '0.0', 'seconds'],
is there a single command which will give me a string=20
tftp> Sent 1943 bytes in 0.0 seconds

OR do i have to do=20

stat_str =3D ''
for elt in status:
    stat_str =3D stat_str + ' ' + elt

TIA,
Praveen.

------=_NextPart_000_012D_01C0D712.038317C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If i have a list </FONT><FONT =
face=3DArial=20
size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>status =3D ['tftp&gt;', 'Sent', '1943', =
'bytes',=20
'in', '0.0', 'seconds'],</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>is there a single command which will =
give me a=20
string </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tftp&gt; Sent 1943 bytes in 0.0=20
seconds</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>OR <FONT face=3DArial size=3D2>do i =
have to do=20
</FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>stat_str =3D ''</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>for elt in status:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; <FONT face=3DArial =
size=3D2>stat_str=20
=3D <FONT face=3DArial size=3D2>stat_str + ' ' + =
elt</FONT></FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>TIA,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Praveen.</FONT></DIV></BODY></HTML>

------=_NextPart_000_012D_01C0D712.038317C0--