为什么会运行失败
calss Animal(object):
pass
dog = Animal()
cat = Animal()
dog.name = 'Tim'
dog.age = 4
cat.name = 'Aim'
cat.age = 5
print(dog.name)
print(dog.age)
print(cat.name)
print(cat.age)
calss Animal(object):
pass
dog = Animal()
cat = Animal()
dog.name = 'Tim'
dog.age = 4
cat.name = 'Aim'
cat.age = 5
print(dog.name)
print(dog.age)
print(cat.name)
print(cat.age)
2021-01-20
举报