Does anything about these two classes “smell” wrong?
class Dog:
def __init__(self, name='', bites=True):
self.name = name
self.genus = 'canis'
self.bites = bites
def get_sound(self):
return 'woof'
class Cat:
def __init__(self, name, lives=9):
self.name = name
self.genus = 'felis'
self.lives = lives
def get_sound(self):
return 'meow'
Draw an appropriate hierarchy for the following.
Build an hierarchy that distinguishes dogs, cats and fleas, supporting the following features.
Label the following as either instantiation, inheritance or composition.