class Animal(object):
count = 0
def __init__(self, name):
self.name = name
Animal.count += 1
animal1 = Animal('Cat')
print(animal1.count)
animal2 = animal('Dog')
print(animal2.count)
copy 的你的代码,改了大小写
animal2 = animal('Dog')
animal2 = Animal('Dog')
大小写