Your task
Create Animal with speak() returning "..." and Cat(Animal) overriding it to return "Meow". Print Cat().speak().
Expected output
Meow
Worked solution
class Animal:
def speak(self):
return "..."
class Cat(Animal):
def speak(self):
return "Meow"
print(Cat().speak())Checks compare printed output, not your approach. Several solutions can be valid.
← Back to courses