stuff function objects into data structures : Function Object : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Function Object »

 

stuff function objects into data structures


def echo(message):                  
    print message 


schedule = [ (echo, 'Spam!'), (echo, 'Ham!') ]
for (func, argin schedule:
    func(arg)



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Function
» Function Object