Question OOP-POLY-0011
MediumWhat is the output of this code?
class Cat:
def speak(self):
return "Meow"
class Dog:
def speak(self):
return "Woof"
print(" ".join(a.speak() for a in [Cat(), Dog()]))
- A.
Sound Sound
- B.
Meow Woof
- C.
Sign up free to see the answer and a step-by-step explanation.