Nov-29-2021, 08:17 PM
Hello,
here's a simplified version of what's causing me trouble :
Thank you !
here's a simplified version of what's causing me trouble :
x = int
def init(): #
x = 0
return
def f():
x += 1
return
init()
f()
f()
print(x)Error:8: Local variable 'x' defined in enclosing scope on line 1 referenced before assignementWhat does this error mean in this context ? Aren't variables defined outside of functions set to global by default ? Thank you !
