1
为什么在调用tst时以下变量(A,B,C,D)不会被更改。Python:变量不会被重新分配
A,B,C = 0,0,0
D = 0
def tst():
A,B,C = 1,2,3
D = 4
print(A,B,C,D)
tst() # tst is called
print(A,B,C,D)
Output:
(1, 2, 3, 4)
(0, 0, 0, 0)