728x90 반응형 examples1 [Ex] scope 이해. 다음 코드의 동작을 주석을 달아서 설명해보자.x = 10def func_one(): x = 20 def func_two(): y = 30 def func_three(): y = 11 nonlocal x print(f"func_three: {x = }, {y = }") x = 777 func_three() print(f"func_two: {x = }, {y = }") func_two() print(f"func_one: {x = }")func_one()print(f"global: {x = }") 참고:2023.07.15 - [Python].. 2025. 5. 12. 이전 1 다음 728x90 반응형