代码示例:(标识:python_variables_global_1)
python_variables_global_1.py
x = "awesome"

def myfunc():
  print("Python is " + x)

myfunc()
运行结果: