def fuc():
for i in range(2)
myval=1
print(myval)
Why is "myval" still accessible even after the for loop? I recall in C, if a variable is set up in a loop, it is only accessible in the loop. So in order to print it like this, I'd have to decleare it outside the loop first. Does anyone know why? In what scope does the variable live in Python?