为什么我写出来的显示name 'Cat'未定义?
Topic sourceclass Animal(object):
def run(self):
print('Animal is running')
class Dog(Animal):
def run(self):
print('dog is running')
class Cat(Animal):
def run(self):
print('cat is running')
dog=Dog()
dog.run()
cat=Cat()
cat.run()
格式没弄对,这下好了
- 1
董DHH董