1 y = 23 2 3 4 def func(): 5 global y 6 # global 声明y为全局变量 7 y = 5 8 print(y) 9 10 11 func() 12 13 print(y) 14 15 16 >5 17 >5