demo_lambda_both.py:
def myfunc(n): return lambda a : a * n mydoubler = myfunc(2) mytripler = myfunc(3) print(mydoubler(11)) print(mytripler(11))
➜ begtut>python demo_lambda_both.py
22
33