Chris Rebert <c...@rebertia.com> writes:

> On Thu, Jun 4, 2009 at 9:07 PM, kj<no.em...@please.post> wrote:
> >
> >
> > Suppose I have two lists, list_a and list_b, and I want to iterate
> > over both as if they were a single list.
[…]

> Just add the lists together.
> 
> for x in list_a + list_b:
>     foo(x)

Which, more precisely, creates a *new* list as the concatenation of the
two existing lists.

-- 
 \             “A good politician is quite as unthinkable as an honest |
  `\                                       burglar.” —Henry L. Mencken |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to