I have these classes:
class Animal(abc.ABCMeta):
@abc.abstractmethod
def speak(self):
raise NotImplementedError()
def speak_twice(self):
self.speak()
self.speak()
class Cat(Animal):
def speak(self):
print("Meow")
class Dog(Animal):
def speak(self):
print("Voff")
And the outcome is this:
Meow
Meow
when I use buster.speak_twice()
I want the outcome to be this:
"Meow Meow"
I've tried changing a lot in the speak_twice
function, like making the 2 different speak to str()
and returning it and I've tried to change it to print.