对着资料做如下练习
class PersianCat(Cat):
def init(self, name):
self.name = name
def eat(self, food):
print(self.name, '正在吃'+food)
在print(self.name, '正在吃'+food)中一直报错是咋回事
同时还有这个问题:
为啥又报错了
c=Cat('Tom')
Traceback (most recent call last):
File "<pyshell#20>", line 1, in <module>
c=Cat('Tom')
TypeError: Cat() takes no arguments