About Lesson
Nested function:-
जब एक function के अन्दर दूसरा function define किया जाए तो उसे nested function कहते हैं
def fun1(): print(“outer function”) def fun2(): print(“inner function”) fun2() fun1() Output outer function inner function |
Note:- 1. Fun2 एक local function है fun1 का
2. fun2 को fun1 के बाहर directly access नहीं किया जा सकता है।
Nested function:-
When a function is defined inside another function, it is called a nested function
def fun1(): print(“outer function”) def fun2(): print(“inner function”) fun2() fun1() Output outer function inner function |
Note:- 1. Fun2 is a local function of fun1
2. fun2 cannot be directly accessed outside fun1.