Lookup variable used in lambda : Lambda : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Lambda »

 

Lookup variable used in lambda


def weird():
    spam = 42
    handler = (lambda: spam * 2)    
    spam = 50
    print handler()                 
    spam = 60
    print handler()                 
    
weird()



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Function
» Lambda