Lambda Function in Hindi

What is Lambda Function

Lambda Function एक anonymous (nameless) function होता है जिसे “lambda” keyword का use करके बनाया जाता है। जब हमे कोई छोटा function (जो एक ही line में define हो जाए) बनाना होता है तो हम lambda function बनाते है।

SYNTAX

lambda arguments : expression

Nested Lambda Function

जब एक lambda function के अंदर किसी दूसरे lambda function को use करते है या फिर वो lambda function किसी दूसरे function को return करता है तो उसे nested lambda function कहा जाता है।

Lambda Function with if-else

Lambda function में एक line का if-else condition यानि की ternary operator को use किया जा सकता है।

Lambda Function with List Comprehension

Lambda function को हम list comprehension (यानि list body में lambda function define करना) में use कर सकते है। इसका mostly use list transformation में किया जाता है, for example किसी number list के सारे items का square list बनाना हो तो हम इस technique से बना सकते है।

IIFE

IIFE (Immediately Invoked Function Expression) एक ऐसा function होता है जो बनते ही execute हो जाता है, but python में हम normal function (जो “def” keyword के use से बनते है) से IIFE function नहीं बना सकते, क्योंकि ऐसा करने पर syntax error आ जाएगा, इसीलिए हम lambda function का use करके IIFE function को create करते है।

उम्मीद करते है कि आपको Lanbda Function अच्छे समझ मे आ गया होगा। अपने learning को continue रखने के लिए next button पर click करे,

Add a comment...

  • All Posts
  • Artificial Intelligence
  • Computer Fundamentals
  • Computer Networks
  • Data Analytics
  • Data Science
  • DBMS
  • Deep Learning
  • Digital Electronics
  • DSA with Python
  • Excel
  • Exercise
  • Git & Github
  • Machine Learning
  • Matplotlib
  • Natural Language Processing
  • NumPy
  • Operating System
  • Pandas-s
  • Power BI
  • Python Tutorial
  • Scikit-learn
  • Seaborn
  • SQL & MySQL
computer networks

Table of Contents All Chapters 1. OSI Model      1.1. Physical Layer      1.2. Data Link Layer  ...

computer networks

Table of Contents All Chapters 1. Topology 2. Types of Topology      2.1. Point to Point Topology    ...

computer networks

Table of Contents All Chapters 1. Data Communication 2. Types of Data Communication      2.1. Simplex      2.2....

digital electronics number system

Table of Contents All Chapters 1. Logic Gate 2. AND Gate      2.1. AND Gate Truth Table 3. OR...

Edit Template

Sign up to track your learning

Login to continue your learning tracking

To reset your password, please enter your email address or username below.

Scroll to Top