Return a lambda function : Return : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Return »

 

Return a lambda function


def weird():
    spam = 42
    return (lambda: spam * 2)     

act = weird()
print act()     # prints 84



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Function
» Return