What is lambda functions in Python?

Technology CommunityCategory: PythonWhat is lambda functions in Python?
VietMX Staff asked 3 years ago

lambda function is a small anonymous function. A lambda function can take any number of arguments, but can only have one expression.

Consider:

x = lambda a : a + 10
print(x(5)) # Output: 15