class Person: x = 'abc' def __init__(self, name, age=19): self.name = name self.y = age #print("pengjai") def show(self,y): # print(x) Person.x = ytom=Person("jia")tom.show(2) #self就是实例化对象Person.show(2,8) #直接将self当做形参来