Lambda evaluation

Steve M sjmaster at gmail.com
Thu Oct 6 22:52:06 CEST 2005


Here's another one:

>>> d = {}
>>> for x in [1,2,3]:
... 	d[x] = (lambda z: lambda y: y * z) (x)
... 	
>>> d[1](3)
3
>>> d[2](3)
6




More information about the Python-list mailing list