Program - local vs. enclosed


Topic: Program - local vs. enclosed

Solution

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



List all Python Programs