class first():
def __init__(self, name, age):
self.name = name
self.age = age
def animal(self, color):
self.color=color
pig=animal("red")
print(pig.color)
為什麼這樣寫有錯誤
class first():
def __init__(self, name, age):
self.name = name
self.age = age
class animal(first):
def __init__(self, coler, name=None, age=None)
super().__init__(name, age)
self.coler = coler
pig=animal("red")
print(pig.color)