Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news2.glorb.com!news-out.octanews.net!indigo.octanews.net!auth.brown.octanews.com.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: De-tupleizing a list References: <8dcab23b-6e38-41d0-9591-ef3cbfdbd589@a21g2000prj.googlegroups.com> Date: Mon, 25 Apr 2011 21:08:49 -0700 Message-ID: <7x1v0pmz72.fsf@ruckus.brouhaha.com> Organization: Nightsong/Fort GNOX User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:YR2oqF+yMiYDRAiupD0jLaRrBTU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 11 NNTP-Posting-Date: 25 Apr 2011 23:08:49 CDT X-Complaints-To: abuse@octanews.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4020 Gnarlodious writes: > I have an SQLite query that returns a list of tuples: > [('0A',), ('1B',), ('2C',), ('3D',),... > What is the most Pythonic way to loop through the list returning a > list like this?: > ['0A', '1B', '2C', '3D',... Try: tlist = [('0A',), ('1B',), ('2C',), ('3D',)] alist = [x for (x,) in tlist]