If a function body is a single return expression statement, you may choose to replace the function with the special lambda expression form : Lambda : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Lambda »

 

If a function body is a single return expression statement, you may choose to replace the function with the special lambda expression form


aList = [123456789]
low = 3
high = 7
print filter(lambda x, l=low, h=high: h>x>l, aList)    # returns: [456]



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Function
» Lambda