这里就是一个继承,还有类属性得一个原因,不一定按照我得来,你可以这么做:
#coding=utf-8
class One:
'''
继承
'''
count = 0
def __init__(self,model,number):
self.model = model
self.number = number
One.count = number
class Two(One):
def __init__(self):
print(self.count)
if __name__ == "__main__":
t = One("haha",4)
ak = Two()
看懂了么?