def callback(msg):
    print(msg)

def callback_factory(m):
    return lambda : callback(m)
funcList = []
for m in ('do', 're', 'mi'):
    funcList.append(callback_factory(m))
for f in funcList:
    f()
Scope of python lambda functions and their parameters