On 12/15/2011 9:42 PM, Chris Angelico wrote:
On Fri, Dec 16, 2011 at 11:57 AM, Terry Reedy<tjre...@udel.edu>  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".

Please read the context that you removed.
The original second return line and my replacements come after

if len(items) <= 2:
  return " and ".join(items)

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to