def a (): q=1+2 return qdef b (): a() c=2+q print cb()总是出现这个错误,NameError: global name 'q' is not defined怎么解决???????
函数中的变量在外面调用,需要申明为全局变量