Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
About Lesson

Lambda Functions

                  Lambda functions को बिना किसी नाम के anonymously define किया जाता है। इनको आप एक object को assign करते है और उसी object नाम के द्वारा इन्हे use किया जाता है। lambda function को anonymous function भी कहा जाता है।

lambda function can take any number of arguments, but can only have one expression.

Lambda Keyword

               Python में normal functions को def keyword द्वारा और lambda functions को lambda keyword द्वारा define किया जाता है। 

Syntax:     lambda <arguments> : expression

  • Lambda function केवल एक लाइन allow करता है

x=lambda a:a+10

y=x(5)

print(y)        

Output

15

x=lambda a:a+10

print(x(5))  

Output

15

 

 

Lambda Functions

                  Lambda functions are defined anonymously without any name. You assign them to an object and they are used by the same object name. Lambda function is also called anonymous function.

lambda function can take any number of arguments, but can only have one expression.

Lambda Keyword

                 In Python, normal functions are defined by the def keyword and lambda functions are defined by the lambda keyword.

Syntax:           lambda <arguments> : expression

  • Lambda function allows only one line

x=lambda a:a+10

y=x(5)

print(y)        

Output

15

x=lambda a:a+10

print(x(5))  

Output

15

 

error: Content is protected !!