No.<div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">L1, L2 = zip(*L)</font><br><br><div class="gmail_quote">2011/8/7 Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Sat, Aug 6, 2011 at 6:07 PM, smith jack <<a href="mailto:thinke365@gmail.com">thinke365@gmail.com</a>> wrote:<br>

> if a list L is composed with tuple consists of two elements, that is<br>
> L = [(a1, b1), (a2, b2) ... (an, bn)]<br>
><br>
> is there any simple way to divide this list into two separate lists , such that<br>
> L1 = [a1, a2... an]<br>
> L2=[b1,b2 ... bn]<br>
><br>
> i do not want to use loop, any methods to make this done?<br>
<br>
</div>One easy way is to use list comprehensions. Technically that'll<br>
involve a loop, but the loop is handled efficiently under the hood.<br>
<br>
L1 = [x[0] for x in L]<br>
L2 = [x[1] for x in L]<br>
<br>
Another way would be to construct a dictionary from your list of<br>
tuples and then use the keys() and values() of that dictionary to form<br>
your lists (use collections.OrderedDict if the order matters). But I<br>
think the list comps are the best way.<br>
<br>
ChrisA<br>
<div><div></div><div class="h5">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div>