human
I am working on the file "Section 2 - Advance Python/Chapter S2.01 - Functional Programming/02_01_Functions_as_First_Class_citizens.ipynb".
The first task is:
the reason we got 21 is due to the fact that increment returns one move value than the number passed to it. In our case we passed 10 to done, which increased it to 20 before passing it to increment function and inturn received 21 from increment.
Nested Functions
Python allows function(s) to be defined within the scope of another function. In this type of setting the inner function is only in scope inside the outer function, thus inner functions are returned (without executing) or passed into another function for more processing.
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.
So, we have two functions, outer and inner. outer function returns the instance of inner function and inner function performs some operations on the values provided and returns them.
Can you write Python program for it?
 ... Give me 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(10)