Re: How to generate "a, b, c, and d"?
- From: Chris Angelico <rosuav@xxxxxxxxx>
- Date: Fri, 16 Dec 2011 13:42:17 +1100
On Fri, Dec 16, 2011 at 11:57 AM, Terry Reedy <tjreedy@xxxxxxxx> wrote:
items[-1] = "and " + items[-1]
return ", ".join(items)
This works only if you're sure there are at least two items, and if
you don't mind two items coming out as "a, and b".
ChrisA
.
- References:
- How to generate "a, b, c, and d"?
- From: Roy Smith
- How to generate "a, b, c, and d"?
- Prev by Date: Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]
- Next by Date: Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]
- Previous by thread: Re: How to generate "a, b, c, and d"?
- Next by thread: Re: How to generate "a, b, c, and d"?
- Index(es):