Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-30 Thread mark floyd
I was doing some testing with the different ways to pass arguments into functions and ran into what looks like a bug. Given function, def foo(a,b,c): print a print b print c # Call function with named parameter list, leaving 'b' out foo(a=1, c=3) Traceback (most recent call last):

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