Question OOP-POLY-0045
MediumWhat is the output of this code?
class Dog:
def speak(self): return "Woof"
class Robot:
def speak(self): return "Beep"
print(" ".join(x.speak() for x in [Dog(), Robot(), Dog()]))
- A.
Error: Robot is not an animal
- B.
Beep Beep Beep
- C.
Sign up free to see the answer and a step-by-step explanation.