python anonymous function

def sum ( a, b ):			# non anonymous
        return a+b
print (sum(1, 2))			# 3

sum = lambda a,b: (a+b)		# anonymous / lambda
print (sum(1, 2))			# 3

Here is what the above code is Doing:
1. We define a function named sum that takes two arguments a and b.
2. We return the sum of a and b.
3. We call the function sum with arguments 1 and 2.
4. We assign the lambda expression to the variable sum.
5. We call the lambda expression with arguments 1 and 2.

As you can see, the output of both the function and the lambda expression is the same.

Lambda expressions are used when you need a function for a short period of time.

Lambda expressions are also known as anonymous functions.

Lambda expressions are used along with built-in functions like filter(), map() etc.

Lambda expressions are used with the keyword lambda.

Lambda expressions contain only one statement.

Lambda expressions can take any number of arguments but can only have one expression.

Lambda expressions cannot contain any statements.

Lambda expressions are written in a single line.

Lambda expressions are used to create small, one-time and anonymous functions.

Lambda expressions are used to pass function objects as parameters to other functions.

Lambda expressions are used to make inline function definitions.

Lambda expressions are used to return function objects from other functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to create anonymous functions.

Lambda expressions are used to