Multiple variable control in for loops. Doable in Python?

2008-07-18 Thread mark floyd
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. Examples: # In Perl for($i = 0, j = 0; $i I_MAX $j J_MAX; $i+=5, $j += 10) { . do something } // In Java

Re: Multiple variable control in for loops. Doable in Python?

2008-07-18 Thread Eduardo O. Padoan
On Fri, Jul 18, 2008 at 4:21 PM, mark floyd [EMAIL PROTECTED] wrote: 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. Examples: # In Perl for($i = 0, j = 0; $i

Re: Multiple variable control in for loops. Doable in Python?

2008-07-18 Thread Derek Martin
On Fri, Jul 18, 2008 at 12:21:49PM -0700, mark floyd wrote: 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. [...] I spent a good part of yesterday looking for a way

Re: Multiple variable control in for loops. Doable in Python?

2008-07-18 Thread Derek Martin
On Fri, Jul 18, 2008 at 05:28:32PM -0400, Derek Martin wrote: def control(i, j): print i,j if not (i 5 or j 10): Rather, if not (i 5 and j 10): return else: control(some_increment_function(i), other_increment_function(j)) -- Derek D. Martin