这个问题已经有了答案:
我正在处理一个项目,并在运行脚本时不断得到变量未定义错误。如何在不声明全局变量的情况下解决此问题
def func1(): x = 1 def func2(): y=5 x + y = z print(z)