# http://www.python.org/doc/2.5.4/tut/node6.html#lambda def make_incrementor(n): return lambda x: x + n f = make_incrementor(42) print f(0) print f(1)