human
13=2*4+5
F -&gt.
product_func
m =&gt.
5
x -&gt.
2
y -&gt.
4
2*4+5 = 8+5 = 13
In the above example higher-order function that takes two inputs- A function F(x) and a multiplier m.
Nested Functions
In Python, Function(s) can also be defined within the scope of another function. If this type of function definition is used the inner function is only in scope inside the outer function, so it is most often useful when the inner function is being returned (moving it to the outer scope) or when it is being passed into another function.
Notice that in the below example, a new instance of the function inner() is created on each call to outer(). That is because it is defined during the execution of outer(). The creation of the second instance has no impact on the first.

What is a the Python program you requested?
assistant
#Here is the Python program you requested.
def outer(a):
    """
    Outer function 
    """
    y = 0
    
    def inner(x):
        """
        inner function
        """
        y = x*x*a 
        return(y)
    print(a)
    
    return inner

my_out = outer

my_out(102)

o = outer(10)
b = outer(20)
print("*"*20)
print(b)
print(o)
print("*"*20)
print(o(10))
print(b(10))

def outer():
    """
    Outer function 
    """
    if 'a' in locals():
        a +=10
    else:
        print("~"),
        a = 20
    def inner(x):
        """
        inner function
        """
        return(x*x*a)
    print(a)
    return inner

# oo = outer
# print(oo.__doc__)
o = outer()
print("*"*20)
print(o)
print(o(10))
print(o.__doc__)

b = outer()
print(b)
print(b(30))
print(b.__doc__)

x = 0

def outer():
    x = 1
    def inner():
        x = 2
        print("inner:", x)

    inner()
    print("outer:", x)

outer()
print("global:", x)