Phython
python 글로벌 변수 메소드에서 사용방법
동동(이재동)
2019. 5. 21. 12:34
글로벌 변수를 사용할려면 global을 메소드안에서 선언해 줘야 한다.
x = 10
def foo():
global x
x += 1
print x
foo()
https://eli.thegreenplace.net/2011/05/15/understanding-unboundlocalerror-in-python