Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Animal:
- def __init__(self,name):
- self.name = str(name)
- class Dog(Animal):
- def __init__(self,name, age, number_of_legs):
- self.name = str(name)
- self.age = int(age)
- self.number_of_legs = int(number_of_legs)
- def produce_sound(self):
- print("I'm a Distinguishedog, and I will now produce a distinguished sound! Bau Bau.")
- class Cat(Animal):
- def __init__(self,name, age, iq):
- self.name = str(name)
- self.age = int(age)
- self.iq = int(iq)
- def produce_sound(self):
- print(f"I'm an Aristocat, and I will now produce an aristocratic sound! Myau Myau.")
- class Snake(Animal):
- def __init__(self,name, age, cruelty):
- self.name = str(name)
- self.age = int(age)
- self.iq = int(cruelty)
- def produce_sound(self):
- print("I'm a Sophistisnake, and I will now produce a sophisticated sound! Honey, I'm home.")
- all_the_fucking_animals = []
- while True:
- data = input()
- if data == "I'm your Huckleberry":
- break
- meta_data = data.split()
- if meta_data[0] == "Dog":
- dog_name = meta_data[1]
- age = meta_data[2]
- limbs = meta_data[3]
- dog = Dog(dog_name,age,limbs)
- all_the_fucking_animals.append(dog)
- elif meta_data[0]=="Cat":
- cat_name = meta_data[1]
- age = meta_data[2]
- iq = meta_data[3]
- cat = Cat(cat_name, age, iq)
- all_the_fucking_animals.append(cat)
- elif meta_data[0] == "Snake":
- snake_name = meta_data[1]
- age = meta_data[2]
- cruelty = meta_data[3]
- snake = Snake(snake_name, age, cruelty)
- all_the_fucking_animals.append(snake)
- if meta_data[0] == 'talk':
- name = Animal(meta_data[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement