스코프 이해하기
이 스크립트는 어떤 네 가지 값을 출력하나요?
x = 50
def one():
x = 10
def two():
global x
x = 30
def three():
x = 100
print(x)
for func in [one, two, three]:
func()
print(x)
이 연습은 강의의 일부입니다
이 스크립트는 어떤 네 가지 값을 출력하나요?
x = 50
def one():
x = 10
def two():
global x
x = 30
def three():
x = 100
print(x)
for func in [one, two, three]:
func()
print(x)
이 연습은 강의의 일부입니다