what happens to the array generated by python 2.X range() function at the end of loop ?
Is the array deleted immediately or its present till the scope of respective function
Warning: For-loop variables “leaking” into the global namespace
In contrast to some other programming languages, for-loops will use the scope they exist in and leave their defined loop-variable behind.
So, for example, number in : for number in range(0,5) will still be accessible after the loop (and will have the last value it was given.
for x in range(...):then yes it is garbage collected after the loop since its reference count is 0.