Header Ads

Responsive Ads Here

Closures in python

Closures in Python


# def sq(a):
#     return a ** 2

# b = sq
# print(b())

def first_func():
    def sec_func():
        print("This is sec func....")
    return sec_func

my_var = first_func()
# my_var = sec_func
print(my_var())

Powered by Blogger.