代码示例:(标识:python_scope_5)
python_scope_5.py
def myfunc():
  global x
  x = 100

myfunc()

print(x)
运行结果: