问题描述 在定义python类时,把参数的初始化写在了__init__函数外面: class test: list_t=[] num=0 def __init__(self,num): self.num=num def add(self,subject