Код: Выделить всё
class animal(object):
def __init__(self,name):
self.name = name
def eat(self,food):
print("{} is eating".format(self.name,food))
class dog():
def fetch(self,thing):
print("{} get the {}".format(self.name,thing))
s = dog('r')
ошибка: Traceback (последний вызов — последний): File
"C:\EclipseWorkspaces\csse120\LearnPython\inheritance.py ", строка 14, в
s = Dog('r') TypeError: Dog() не принимает аргументов
Код: Выделить всё
Cant figure out whats wrong, please help.
Подробнее здесь: https://stackoverflow.com/questions/547 ... -arguments