What will the following piece of code print? (10 or 15)
def testClosure(max Index) :
def closureTest():
return maxIndex
maxIndex += 5
return closureTest()
print testClosure(10)
My question is when the closure function gets value for maxindex? Run
time or compile time?
Thanks.
def testClosure(max Index) :
def closureTest():
return maxIndex
maxIndex += 5
return closureTest()
print testClosure(10)
My question is when the closure function gets value for maxindex? Run
time or compile time?
Thanks.
Comment