DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 968,873 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
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)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.