function expression with 2 arguments

Harlin Seritt harlinseritt at yahoo.com
Sat Feb 26 07:41:21 EST 2005


Not exactly sure what you're looking for but you can do the following:

def dosomething(numlist):
   return numlist[0] + numlist[1]

numlist = [ 5, 10]
val = dosomething(numlist)

If so, that would be somewhat pointless. It's always best to keep it
simple. It looks like the function you wrote above is very adequate for
the results you want returned.




More information about the Python-list mailing list