标签: function python-3.x
如何从callx访问x到callxAgain? 代码:
def callxAgain(): print(x) def callx(): x = 1 callxAgain() callx()
答案 0 :(得分:0)
您需要将x的值传递给callxAgain()函数:
def callxAgain(x): print(x) def callx(): x = 1 callxAgain() callx()