Nested Function in Hindi

What is Nested Function

जब हम किसी function के अंदर दूसरे function को define करते है तो उसे nested function कहा जाता है।

Return Function from Function

Python में कोई function किसी दूसरे function को return कर सकता है।

Higher Order Function

ऐसा function जो किसी function को argument के रूप में ले और किसी function को return करे तो ऐसे function को Higher Order Function कहेंगे।

Function Recursion

Function मे recursion तब होता है जब हम किसी function मे ही उसी function को call करते है 

SYNTEX

def function_name()

       function_name()

Closure

जब एक nested function अपने enclosing function (बाहर वाला function) के variables को याद करता है जबकि enclosing function execute हो चुका हो, तो उसे Closure कहते है।

Decorator

Decorator एक ऐसा nested function है जो किसी दूसरे function के behavior को change या extend कर है, बिना उस function के code को बदले।

Decorators का use हम तब करते है जब हमे किसी function में extra functionality add करना हो, या बिना उस function के code को modify किए उसमे कोई नया behavior inject करना हो।

किसी function पर decorator को manually apply कर सकते है but अक्सर @decorator syntax किया जाता है इस syntax में हमे जिस भी function पर जो decorator apply करना हो हम simply उस function के ऊपर “@” के साथ उस decorator के name (@decorator_name) को लिख देता है। 

हम जिस function पर decorator को apply करना चाहते है अगर वो function कोई arguments लेता है तो wrapper (decorator के अंदर वाला function) में “*args” और “**kwargs” लिखना जरूरी होता है।

उम्मीद करते है कि आपको Nested 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