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)