我的为什么错误
class Person(object): count =0 def __init__self(self,name): self.name=name Person.count=Person.count+1 p1 = Person('Bob') print Person.count p2 = Person('Alice') print Person.count p3 = Person('Tim') print Person.count
class Person(object): count =0 def __init__self(self,name): self.name=name Person.count=Person.count+1 p1 = Person('Bob') print Person.count p2 = Person('Alice') print Person.count p3 = Person('Tim') print Person.count
2018-11-11
举报