Of what use is 'lambda'???
tye4
tye4 at yahoo.com
Mon Sep 18 21:43:27 EDT 2000
More information about the Python-list mailing list
Mon Sep 18 21:43:27 EDT 2000
- Previous message (by thread): Of what use is 'lambda'???
- Next message (by thread): Of what use is 'lambda'???
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The lambda definition is limited to only one expression, and everything
you do with lambda, can also be done with plain functions.
>>> adder1 = lamda a, b : a + b
>>> def dosum(a, b):
return a + b
>>> adder2 = dosum
>>> adder1(2, 3)
5
>>> adder2(2, 3)
5
So, does lamda have a feature that regulars funcs have or is just there
for convenience??
-tye4
- Previous message (by thread): Of what use is 'lambda'???
- Next message (by thread): Of what use is 'lambda'???
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list