def f():
L = []
for i in range(5):
def n():
return i
L.append(n)
return L
L = f()
print(L[0]())
print(L[1]())
print(L[2]())
print(L[3]())
print(L[4]())
the output of the above codes is
4
4
4
4
4
my questions is: after L=f(), is the local namespace of f destructed? if so, how is the i in function n associated with i in the namespace? if not, when is a local namespace to be destructed?