<div dir="ltr">I'm new to Python and have been doing work converting a few apps from Perl to Python.  I can not figure out the comparable Python structures for multi-variable for loop control.<br><br>Examples:<br><br># In Perl<br>
for($i = 0, j = 0; $i < I_MAX && $j < J_MAX; $i+=5, $j += 10)<br>{<br>   ..... do something<br>}<br><br>// In Java<br>class test {<br>     public static void main(String[] args){<br>          int i = 0;<br>          int j = 1;<br>
          for(i=1, j = 0; i<11 && j < 10; i++, j++){<br>               System.out.println("I is: " + i);<br>               System.out.println("J is: " + j);<br>          }<br>     }<br>}<br>
<br><br>// In C<br>#include <stdio.h><br>int main()<br>{<br>  int j = 0;<br>  int k = 0;<br><br>  for(j = 0, k = 0; j < 5 && k < 10; j++, k++) {<br>    printf("J = %d\n", j);<br>    printf("k = %d\n", k);<br>
    }<br>  <br>  return 0;<br>  }<br><br>I spent a good part of yesterday looking for a way to handle this style for loop in Python and haven't been able to find an appropriate way to handle this control style.  We have this style for loop all over the place and not being able to find a similar structure in Python could be a problem.  Any pointers to a Python equivalent structure would be much appreciated<br>
<br>- Mark<br></div>