LAMBDA IS IT USELESS?

EricIDLE grayson-wilson at home.com
Wed Jul 11 23:27:21 EDT 2001


Ok well I dont quite grasp the Lambda concept heres an example.

def mult(x,y):
    return x * y
f = reduce(lambda x,y: x*y,n)
print f

*NOTE   The varible N is defined in the code before this excerpt.

Anyways back to the point the book says this is easier!?!?

But comon sense tells me this is easier.

def mult(x,y):
    return x * y
f = reduce(mult,n)
print f

Isnt that easier??

Or do I not get lambda?

*NOTE ... I think its just a way to complicate things OR just a way to avoid
typing the function name beacuse.... I dont know they are scared of the
names they give them.





More information about the Python-list mailing list