Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.08; "john's": 0.09; 'subject:Extracting': 0.09; 'cc:addr:python-list': 0.15; '"del"': 0.16; 'compact': 0.16; 'guys,': 0.16; 'received:192.168.200': 0.16; 'wrote:': 0.18; 'seems': 0.19; 'cc:no real name:2**0': 0.21; 'asked': 0.22; 'cheers': 0.23; 'header:In-Reply-To:1': 0.23; 'cc:2**0': 0.25; 'statement': 0.25; 'skip:[ 10': 0.27; 'cc:addr:python.org': 0.29; 'subject:?': 0.31; 'thanks': 0.31; 'quite': 0.32; 'instead': 0.33; 'header:User- Agent:1': 0.33; 'loop': 0.34; 'elegant': 0.34; 'something': 0.36; 'subject:lists': 0.36; 'but': 0.37; 'received:192': 0.38; 'enough': 0.38; 'why': 0.39; 'subject:: ': 0.39; 'header:Received:6': 0.60; 'subject:over': 0.84; 'tricky': 0.84 X-IronPort-AV: E=Sophos;i="4.69,471,1315173600"; d="scan'208";a="2370284" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Mon, 07 Nov 2011 19:51:31 +0100 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: JoeM Subject: Re: Extracting elements over multiple lists? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320691888 news.xs4all.nl 6919 [2001:888:2000:d::a6]:42594 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15429 JoeM wrote: > Thanks guys, I was just looking for a one line solution instead of a > for loop if possible. Why do you consider > > [x.remove(x[0]) for x in [a,b,c]] > > cheating? It seems compact and elegant enough for me. > > > > Cheers > This is a one liner, but since you asked something *pythonic*, John's solution is the best imo: for arr in [a,b,c]: arr.pop(0) (Peter's "del" solution is quite close, but I find the 'del' statement tricky in python and will mislead many python newcomers) JM