Baheeg Training and Test Exam

Python intermediate Level

Score: 0 / 0 answered

Progress: 0 of 817 qs

time elap: 00:00

Question 1: What is the output of the following code?

def outer():
    x = 10
    def inner():
        nonlocal x
        x += 1
        return x
    return inner

closure = outer()
print(closure())
print(closure())