[portland] Two Indices, One For Loop?
python at dylanreinhardt.com
Tue Apr 22 02:50:11 CEST 2008
On Mon, Apr 21, 2008 at 3:09 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> That works. I thought there might be a more direct way.
I don't know if it's more direct or not... but if you don't like zip,
you could pair up labels and items with a list comprehension:
for label, item in [(labels[i], items[i]) for i in range(len(labels))]:
This would only work if you can assume that there are at least as many
items as labels.
More information about the Portland