Function returns another function : Function as Return « Function « Python
- Python
- Function
- Function as Return
Function returns another function

def knights():
title = 'Sir'
action = (lambda x: title + ' ' + x)
return action
act = knights()
print act('robin')
Related examples in the same category