Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'terry': 0.07; 'am,': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; '16,': 0.15; '"and': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'dec': 0.22; 'header:In-Reply- To:1': 0.22; 'message-id:@mail.gmail.com': 0.28; 'least': 0.30; 'there': 0.33; 'fri,': 0.34; 'to:addr:python-list': 0.34; 'subject:How': 0.35; 'skip:" 10': 0.37; 'two': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; '11:57': 0.84; 'items,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Gja3CmbpKcm7rVrdbGBxKIQSongQ8kb4E+O7XTPCS/s=; b=X1aDgvA0BuMDI3zr7riGZCN02ij3oAjaDzw45QgA3UFxRNl6begBM+Nck382yKke5x xy1H1dxgjL9snpDBn3U/2E3ImLvdpz3oc15ZVJakgOGzfSCWaNWA5o4AEE0sDlC916QD HEMkzmLtUdD0xJ05IwBmXU03lqTa/K6Rh2huM= MIME-Version: 1.0 In-Reply-To: References: <9393353.282.1323967703697.JavaMail.geo-discussion-forums@vbyc2> <4EEA2DF2.9080107@mrabarnett.plus.com> Date: Fri, 16 Dec 2011 13:42:17 +1100 Subject: Re: How to generate "a, b, c, and d"? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324003340 news.xs4all.nl 6859 [2001:888:2000:d::a6]:54891 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17325 On Fri, Dec 16, 2011 at 11:57 AM, Terry Reedy wrote: > =A0items[-1] =3D "and " + items[-1] > =A0return ", ".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