Python program to access function iside function


Topic: Python program to access function iside function

Solution

def test(a):
    def add(b):
        nonlocal a
        a += 1
        return a + b
    return add
func = test(4)
print(func(4))



List all Python Programs