[Tutor] writing list elements into a string

2005-12-15 Thread ps python
-Repost. considering that my previous email lost - hi, can any one pls. help me on this simple issue. I keep forgetting some simple things and they turn out to be very important later. i have a list 'a', and now i want to write all the elements back in to a string. 'apple is a good fruit'

Re: [Tutor] writing list elements into a string

2005-12-15 Thread John Fouhy
On 16/12/05, ps python <[EMAIL PROTECTED]> wrote: > >>> a = ['apple','is','a','good','fruit'] > >>> ab ='' > >>> for m in a: > k = ''.join(m) > ab.join(k) You're almost there... >>> a = ['apple', 'is', 'a', 'good', 'fruit'] >>> ' '.join(a) 'apple is a good fruit' >>> '...'.join(a

[Tutor] writing list elements into a string

2005-12-15 Thread ps python
hi, can any one pls. help me on this simple issue. I keep forgetting some simple things and they turn out to be very important later. i have a list 'a', and now i want to write all the elements back in to a string. 'apple is a good fruit' - getting this back into a string has drained my brain.