DEV Community

Cover image for Lambda
francnstein
francnstein

Posted on

3 2

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)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay