examples/advanced/make_incrementor.py
#!/usr/bin/env python
from __future__ import print_function

def make_incrementor(n):
    return lambda x: x + n

f3 = make_incrementor(3)
f7 = make_incrementor(7)

print(f3(2))    #  5
print(f7(3))    # 10
print(f3(4))    #  7
print(f7(10))   # 17