Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.060 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'subject:Extracting': 0.09; 'list?': 0.13; 'cc:addr:python-list': 0.15; 'compact': 0.16; 'guys,': 0.16; 'received:192.168.1.104': 0.16; 'wrote:': 0.18; 'seems': 0.19; 'cc:no real name:2**0': 0.21; 'cheers': 0.23; 'header:In-Reply-To:1': 0.23; 'cc:2**0': 0.25; 'skip:[ 10': 0.27; 'cc:addr:python.org': 0.29; 'subject:?': 0.31; 'thanks': 0.31; 'pm,': 0.31; 'instead': 0.33; 'header:User-Agent:1': 0.33; 'loop': 0.34; 'elegant': 0.34; 'subject:lists': 0.36; 'reference': 0.37; 'two': 0.37; 'received:192': 0.38; 'enough': 0.38; 'why': 0.39; 'subject:: ': 0.39; 'might': 0.39; '19,': 0.68; 'header:Reply- To:1': 0.70; 'content.': 0.71; 'reply-to:no real name:2**0': 0.71; 'subject:over': 0.84 Date: Mon, 07 Nov 2011 15:06:25 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 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 X-Provags-ID: V02:K0:qwEUi4cbC0SPotO2b/fUmWTH8he/RIC9dnp3EA+/Xi5 LTA7hGK3FjGzGwpuC8xWceDsCa7aJQoxK/zKQH7DQlYO+cMDOz jHobbhBCV8NJv3X3dA6ZpxOdUySfjEcRPTefz77H7XqfTy/7Ry EvfbOzRLCu0E4kp8Lij1eCrRVormPsmeR4YFZOx7arowh1BN+H r5lgJJaUmDBBtmt8XcuuipI9+CwByK7NJkc2Ge+8eMUqiU2qGm bQlOwwbxrkC5GQmpEfDeecjWo+kdtNtI0x/I0DLAnExb/hg/4K m6YfK4XiWaHIADOfa8fDXI5HQU5IIDyfqVZdJLgbe6PJRxEGQ= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320696412 news.xs4all.nl 6850 [2001:888:2000:d::a6]:48511 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15431 On 11/07/2011 01:01 PM, 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 Are you considering the possibility that two of these names might reference the same list? a = [42, 44, 6, 19, 48] b = a c = b for x in [a,b,c]: x.remove(x[0]) now a will have [19,48] as its content. -- DaveA