Calling Function inside Function in Python

Calling Function inside Function in Python programming. Functions are used to divide a large program into sub-programs for easy control. All these sub-programs are called sub-functions of the program.

Program Calling Functions Inside the Function

Program

def fun(): #'fun()' is name of Function.
    print("This is fun Function")
    print("This is Also fun Function")
def fun2(): #'fun2()' is name of Function.
    print("This is fun2 Function")
    fun() #calling 'fun()' Function.
    fun3() #calling 'fun3()' Function.
def fun3(): #'fun3()' is name of Function.
    print("This is fun3 Function")
print("Before Calling Functions")
fun2() #calling 'fun2()' Function.
print("After Calling Functions")
Output
Before Calling Functions
This is fun2 Function
This is fun Function
This is Also fun Function
This is fun3 Function
After Calling Functions

Program Calling Functions Inside the Functions

Program

def fun(): #'fun()' is name of Function.
    print("This is fun Function")
    print("This is Also fun Function")
    fun3() #calling 'fun3()' Function.
def fun2(): #'fun2()' is name of Function.
    print("This is fun2 Function")
    fun() #calling 'fun()' Function.
def fun3(): #'fun3()' is name of Function.
    print("This is fun3 Function")
print("Before Calling Functions")
fun2() #calling 'fun2()' Function.
print("After Calling Functions")
Output
Before Calling Functions
This is fun2 Function
This is fun Function
This is Also fun Function
This is fun3 Function
After Calling Functions