Hello,
Its not obvious to me how to do this. I would like to iterate using a tuple as
an index. Say I have two equivalently sized arrays, what I do now seems
inelegant:
for index, list1_item in enumerate(first list):
do_something(li st1_item, secondlist[index])
I would like something more like this:
for list1_item, list2_item in (some_kind_of_e xpression):
do_something(li st1_item, list2_item)
Practically, I'm not so sure B is better than A, but the second would be a
little more aesthetic, to me, at least.
Any thoughts on what "some_kind_of_e xpression" would be?
James
--
James Stroud, Ph.D.
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
Its not obvious to me how to do this. I would like to iterate using a tuple as
an index. Say I have two equivalently sized arrays, what I do now seems
inelegant:
for index, list1_item in enumerate(first list):
do_something(li st1_item, secondlist[index])
I would like something more like this:
for list1_item, list2_item in (some_kind_of_e xpression):
do_something(li st1_item, list2_item)
Practically, I'm not so sure B is better than A, but the second would be a
little more aesthetic, to me, at least.
Any thoughts on what "some_kind_of_e xpression" would be?
James
--
James Stroud, Ph.D.
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
Comment