######代码如下:
class Car:
weight = 10
t = []
car1 = Car()
car2 = Car()
car1.weight = 0
car1.t.append(0)
print(car2.weight)
print(car2.t)
D:\SurvivalGame\venv\Scripts\python.exe D:\SurvivalGame\question.py
10
[0]
Process finished with exit code 0
老问题了,函数也会这样的,只要传进去的是list,他就会全局变动