I am a beginner in Python. Please see the below code:
for line in range(8):
    fact = 1
print(fact)
I received output as 1
My query is since fact variable is withing the scope of for loop, how does Python access the variable outside it's scope. Thank in advance.
 
    