Re: argument matching question

2005-08-26 Thread Scott David Daniels
Leif K-Brooks wrote: > Learning Python wrote: > >>A code like this: >> >>def adder(**varargs): >> sum=varargs[varargs.keys()[0]] >> for next in varargs.keys()[1:]: >>sum=sum+varargs[next] >> return sum For that function, call: print adder(first=1, second=2, thi

Re: argument matching question

2005-08-25 Thread Learning Python
thanks, got it. I want to test the **name option for argument matching. -- http://mail.python.org/mailman/listinfo/python-list

Re: argument matching question

2005-08-25 Thread Leif K-Brooks
Learning Python wrote: > A code like this: > > def adder(**varargs): > sum=varargs[varargs.keys()[0]] > for next in varargs.keys()[1:]: > sum=sum+varargs[next] > return sum > > print adder( "first","second",'third') > > How to pass arguments to a functions that