Marc 'BlackJack' Rintsch wrote: A fine repy > In [57]: funcs = [a, b] > In [58]: funcs > Out[58]: [<function a at 0xb7792e2c>, <function b at 0xb779e1ec>] > > In [59]: funcs[0]() > Out[59]: 1 > > In [60]: funcs[1]() > Out[60]: 2
and a "list comprehension" allows you to call these things no matter how long the list is. So after the above: >>> results = [f() for f in funcs] >>> print results [1, 2] -- http://mail.python.org/mailman/listinfo/python-list