What is the Lambda function in python
This article mainly shows you "what is the Lambda function in python", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the Lambda function in python" this article.
Lambda function
The Lambda function is a relatively small anonymous function-- anonymous means that it doesn't actually have a function name.
The Python function is usually defined using the def a_function_name () style, but for the lambda function, we didn't name it at all. This is because the function of the lambda function is to perform some simple expression or operation without having to fully define the function.
The lambda function can take any number of arguments, but there can only be one expression.
X = lambda a, b: a * bprint (x (5,6)) # prints 30x = lambda a: ahem 3 + 3print (x (3)) # prints 12
The above is all the content of the article "what is the Lambda function in python?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!