class Mammal (object): def __init__(self, name): self.name = name self.stomach = [] def eat(self, food): self.stomach.append(food) print "Yum, thanks for the %s" % food def __repr__(self): return "Mammal named %s" % self.name class Monkey (Mammal): def talk(self, choice=1): if choice == 1: print 'hoot hoot hoot' elif choice == 2: print 'chatter chatter' elif choice == 3: print 'screeeeech!!' else: print 'Monkey scratches head.' def __repr__(self): return "Monkey named %s" % self.name class Dog (Mammal): def talk(self, choice=1): if choice == 1: print 'woof' elif choice == 2: print 'bark!' elif choice == 3: print 'WOOF!' else: print 'Looks confused.' def __repr__(self): return "Dog named %s" % self.name class Human (Mammal): def talk(self, choice=1): if choice == 1: print 'Why hello there.' elif choice == 2: print 'When do we eat?' elif choice == 3: print 'Am I late for class?' else: print 'Appears confused.' def __repr__(self): return "Human named %s" % self.name