代码示例:(标识:python_scope_2)
python_scope_2.py
def myfunc():
  x = 100
  def myinnerfunc():
    print(x)
  myinnerfunc()

myfunc()
运行结果: