|
Davy Mitchell's Meandering Weblog Home - Angus - Christian - Energy - Fun - General - Internet - IronPython - MoodNews - NintendoDS - Personal - Photos - Podcast - Politics - Python - Scotland - Software Blog Statistics Tag Cloud RSS More Feeds Archives2007-05-262007-04-28 2007-04-21 2007-04-07 2007-03-24 2007-03-17 2007-03-10 2007-03-03 2007-02-24 2007-02-17 |
Getting To Grips With Lambda Permalink Today I had the chance to use Lambda for the first time. I was after a list of functions but also wanted properties and variables in the list. funk = [] def bob(): return "starwars" def bib(): return "stargate" wibble = "Matrix" funk.append(bob) funk.append(bib) funk.append(bob) funk.append(bib) funk.append(lambda : wibble) for function in funk: print function() Gives the output: starwars stargate starwars stargate Matrix
Posted by Davy Mitchell on
2007-06-09 13:57:25. |
|