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

def myfunc():
  print(x)

myfunc()

print(x)
运行结果: