[portland] Two Indices, One For Loop?

Rich Shepard rshepard at appl-ecosys.com
Mon Apr 21 23:54:13 CEST 2008


   I have a list of 12 labels and a variable number of rows, each with 12
attributes. I am writing a for loop to print out the label and value for
each row (.tex output).

   Rather than writing (leaving out a lot of the file.write() code)

for item in itemList:
   write(label[0])
   write(item[0])
   write(label[1])
   write(item[1]
   ...

is it possible to write something like:

for i in labelList and for item in itemList:
   write(label[i])
   write(item[i])

?

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863


More information about the Portland mailing list