DEV Community

Cover image for Lambda
francnstein
francnstein

Posted on

Lambda

Lambda functions aren't as powerful as named functions.
They can only do things that require a single expression - usually equivalent to a single line of code.

named function

def polynomial(x):
return x**2 + 5*x + 4
print(polynomial(-4))

lambda

print((lambda x: x**2 + 5*x + 4) (-4))

0
0

Top comments (0)