Re: formatting list -> comma separated (slightly different)

2008-07-21 Thread Niklas Norrthon
On 9 Juli, 22:25, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > Paul & Robert wrote... > > d = ["soep", "reeds", "ook"] > >print ', '.join(d) > > soep, reeds, ook > > I occasionally have a need for printing lists of items too, but in the form: > "Butter, Cheese, Nuts and Bolts".  The last separator

Re: formatting list -> comma separated (slightly different)

2008-07-09 Thread Duncan Booth
Michiel Overtoom <[EMAIL PROTECTED]> wrote: > I occasionally have a need for printing lists of items too, but in the > form: "Butter, Cheese, Nuts and Bolts". The last separator is the > word 'and' instead of the comma. The clearest I could come up with in > Python is below. I wonder if there is

Re: formatting list -> comma separated (slightly different)

2008-07-09 Thread egbert
On Wed, Jul 09, 2008 at 10:25:33PM +0200, Michiel Overtoom wrote: > Formatting a sequence of items such that they are separated by > commas, except the last item, which is separated by the word 'and'. > > For example: > > Three friends have a dinner: Anne, Bob and Chris row = ["Anne","Bob","Chri

Re: formatting list -> comma separated (slightly different)

2008-07-09 Thread Larry Bates
Michiel Overtoom wrote: Paul & Robert wrote... d = ["soep", "reeds", "ook"] print ', '.join(d) soep, reeds, ook I occasionally have a need for printing lists of items too, but in the form: "Butter, Cheese, Nuts and Bolts". The last separator is the word 'and' instead of the comma. The cleare

Re: formatting list -> comma separated (slightly different)

2008-07-09 Thread Michiel Overtoom
Paul & Robert wrote... > d = ["soep", "reeds", "ook"] >print ', '.join(d) > soep, reeds, ook I occasionally have a need for printing lists of items too, but in the form: "Butter, Cheese, Nuts and Bolts". The last separator is the word 'and' instead of the comma. The clearest I could come up with