Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10976

how to separate a list into two lists?

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 <thinke365@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.024
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'subject:two': 0.07; 'done?': 0.09; 'tuple': 0.09; 'elements,': 0.16; 'subject:list': 0.18; 'loop,': 0.23; 'separate': 0.28; 'lists': 0.28; 'message- id:@mail.gmail.com': 0.29; 'subject:?': 0.31; 'list': 0.32; 'there': 0.33; 'to:addr:python-list': 0.33; '...': 0.34; 'subject:lists': 0.36; 'two': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'to:addr:python.org': 0.39
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=sk291S1/huR2bRvbUz/N/XKpex2Y8N/vMaX+xrs2GmA=; b=HlFA8n93lKdstdeQTtWO18r0+erLBcX8ea92sRdpMun23iQ0QVVAoiv8eSBDKm4K8S 28nmXOmdWzhgVBT9MFG9GQSa2ceysp46XQZVaB/JTt20mFlbp+Zgy/pJ5e5FKZGzViee dw/iOX7A/oyuu5JcWfmDNI7HSVfk9G/ucRQls=
MIME-Version 1.0
Date Sun, 7 Aug 2011 01:07:00 +0800
Subject how to separate a list into two lists?
From smith jack <thinke365@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1983.1312650424.1164.python-list@python.org> (permalink)
Lines 8
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1312650424 news.xs4all.nl 23957 [2001:888:2000:d::a6]:55460
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10976

Show key headers only | View raw


if a list L is composed with tuple consists of two elements, that is
L = [(a1, b1), (a2, b2) ... (an, bn)]

is there any simple way to divide this list into two separate lists , such that
L1 = [a1, a2... an]
L2=[b1,b2 ... bn]

i do not want to use loop, any methods to make this done?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

how to separate a list into two lists? smith jack <thinke365@gmail.com> - 2011-08-07 01:07 +0800
  Re: how to separate a list into two lists? bud <only@fleshwound.org> - 2011-08-06 18:13 +0000
    Re: how to separate a list into two lists? Gelonida N <gelonida@gmail.com> - 2011-08-06 22:00 +0200
      Re: how to separate a list into two lists? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-07 10:07 +1000
        Re: how to separate a list into two lists? Gelonida N <gelonida@gmail.com> - 2011-08-07 19:11 +0200
  Re: how to separate a list into two lists? Tim Roberts <timr@probo.com> - 2011-08-06 17:58 -0700
    Re: how to separate a list into two lists? Chris Angelico <rosuav@gmail.com> - 2011-08-07 02:05 +0100
      Re: how to separate a list into two lists? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-07 11:35 +1000
  Re: how to separate a list into two lists? Paul Rubin <no.email@nospam.invalid> - 2011-08-06 22:29 -0700

csiph-web