代码示例:(标识:python_scope_4)
python_scope_4.py
x = 100

def myfunc():
  x = 200
  print(x)

myfunc()

print(x)
运行结果: