list of functions

John nobody at nobody.com
Sat Mar 30 17:34:36 EST 2002


Hi,

I was glad to find that Python allows the following:

def addone(a): return a+1
list_of_functions=[addone]
list_of_functions[0](1)  --> returns 2

However, what if the functions require more than one arguments? say
def addall(a,b,c): return a+b+c?
Though list_of_functions[0](1,2,3) works, I'd like to make (1,2,3) as
variables.. How do I pass the variables to such functions?





More information about the Python-list mailing list