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.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 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 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: 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 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?