what is the output of the following code:
class Dog(Animal):
__owner = None
def __init__(self, name, height, weight, sound, owner):
self.__owner = owner
self.__animal_type = None
# How to call the super class constructor
super(Dog, self).__init__(name, height, weight, sound)
def set_owner(self, owner):
self.__owner = owner
def get_owner(self):
return self.__owner
def get_type(self):
print("Dog")
# We can overwrite functions in the super class
def toString(self):
return "{} is {} cm tall and {} kilograms and says {}. His owner is {}".format(self.get_name(),
self.get_height(),
self.get_weight(),
self.get_sound(), self.__owner)
# You don't have to require attributes to be sent
# This allows for method overloading
def multiple_sounds(self, how_many=None):
if how_many is None:
print(self.get_sound)
else:
print(self.get_sound() * how_many)
spot = Dog("Spot", 53, 27, "Ruff", "Derek")
print(spot.toString())