class Person(object): count = 0 def how_many(): return Person.count def __init__(self, name): self.name = name Person.count = Person.count + 1print (Person.how_many())p1 = Person('Bob')print (Person.how_many())
添加回答
举报
0/150
提交
取消