Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.025 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.01; 'subject:form': 0.07; 'output,': 0.09; 'strings.': 0.09; 'subject:number': 0.09; 'subject:string': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'to:name:python-list@python.org': 0.22; 'skip:% 10': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'dec': 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'd": 0.34; 'received:google.com': 0.35; 'two': 0.37; 'list.': 0.37; 'skip:[ 10': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'easier,': 0.84; 'subject:needed.': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=q2B7iYp9BJxHqipt/U1tB9Z574hHwu8h0/HSTt3cGl4=; b=cncxexLRUyRKOlYdp3d5n1RigB7CZatVKn9nsKmHKwCKKa3bbla7oZC/JCjtCQ4UYV PgpMb/DJwGIYkst5XXKoj7Be1UZQ/ScEm844jFvQW1Y8H4IkcUHAAwMni6g5kUbv70yL ivplUl0SYr3m2Rksbwgf1vAXK30be1vz6I6DmM9wh0+Lpy5Cd3/QykzFoXxgFGIC7kL5 4yAVtVmKb9ugJ+TGKI9cjpZaRU/rJYa2/Iws1bfBBtEnmwRB7bfxQj5fspJoi993M2nj XaMCyt0fbp8ZmHZ61BCG53BFttrSNuhW4eGiokcSmiUhh6tKsRbiaXxUz1z7tAjg2sVN VI3Q== MIME-Version: 1.0 X-Received: by 10.66.164.136 with SMTP id yq8mr21907277pab.67.1387216350963; Mon, 16 Dec 2013 09:52:30 -0800 (PST) In-Reply-To: References: <2333bfb4-cd72-4ed0-9b28-d8dbe26b5be2@googlegroups.com> <6112663707411483025@unknownmsgid> Date: Tue, 17 Dec 2013 04:52:30 +1100 Subject: Re: Concatenate string list to number list to form title - Logic needed. From: Chris Angelico To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387216355 news.xs4all.nl 2845 [2001:888:2000:d::a6]:55578 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62085 On Tue, Dec 17, 2013 at 4:51 AM, Chris Angelico wrote: > t = ['Start','End'] > a = [[1,2,3,4], > [5,6,7,8]] > result = [] > for cur in a: > result.append("%s - %d"%(t[0],cur[2])) > result.append("%s - %d"%(t[1],cur[3])) Whoops, I misread the desired output, I thought you wanted a four-string list. It's two strings. That's actually easier, and Mark's solution is pretty much what I'd go for. ChrisA