On Sat, Oct 8, 2011 at 10:50 PM, Alan Gauld <alan.ga...@btinternet.com>wrote:
> On 08/10/11 11:27, Alan Gauld wrote: > > What you want, I think, is to join the original list >> with spaces(and maybe add a newline for writing to file) >> >> summary = ' '.join(summary) + \n >> > > But you need to make the original items strings first > so it should be: > > summary = ' '.join( map(str,summary) ) + \n > new_summary=' '.join( map(str,summary) ) + \n ^ SyntaxError: unexpected character after line continuation character so I added it as new_summary=' '.join( map(str,summary[1:-3]) ) + "\n" but each one in summary does not show in new line. new_summary='\n'.join(map(str,summary[1:-3])) This one works, > > Sorry about that, Thanks for your suggestions. > > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > ______________________________**_________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor> >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor