Lambda Keyword in Python

 



    Lambda Keyword in Python



    Lambda keyword (What and Why)



    • In this blog we will be understanding, what is Lambda keyword and why we use Lambda keyword in python
    • Lambda is a keyword in python and it is use to define an anonymous function.
    • Ideally these anonymous function is meant for one time use.
    • In Lambda Function we can pass n number of arguments.
    • Syntax as shown below
                    

    • Explanations
      • lambda is a predefine keyword
      • arg1, arg2... are number of arguments
      • And after the : (Colon) we can write our expression.
    • Let's take an example to get more clarity.
                        
    • and here answers will be 25.
    • In the above example we can see we have 2 argument i.e. x and y and after the colon (:) we have expression.