Hi,
No matter what I write, the first 2 test cases won’t pass. Please let me know what’s wrong with below code.
This is regarding the challenge in Python basic Module 2 challenge for learning polymorphism.
class Animal:
def init(self, name, sound):
self.name = name
self.sound = sound
def Animal_details():
print("Name:", self.name)
print("Sound:", self.sound)
class Dog(Animal):
def init(self, name, sound, family):
super().init(name, sound)
self.family = family
def Animal_details():
super().Animal_details()
print("Family:", self.family)
class Sheep(Animal):
def init(self, name, sound, color):
super().init(name, sound)
self.family = color
def Animal_details():
super().Animal_details()
print("Color:", self.color)
Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers