Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. class Animal:
  2. def __init__(self,name):
  3. self.name = str(name)
  4.  
  5.  
  6. class Dog(Animal):
  7. def __init__(self,name, age, number_of_legs):
  8. self.name = str(name)
  9. self.age = int(age)
  10. self.number_of_legs = int(number_of_legs)
  11.  
  12. def produce_sound(self):
  13. print("I'm a Distinguishedog, and I will now produce a distinguished sound! Bau Bau.")
  14.  
  15.  
  16. class Cat(Animal):
  17. def __init__(self,name, age, iq):
  18. self.name = str(name)
  19. self.age = int(age)
  20. self.iq = int(iq)
  21.  
  22. def produce_sound(self):
  23. print(f"I'm an Aristocat, and I will now produce an aristocratic sound! Myau Myau.")
  24.  
  25.  
  26. class Snake(Animal):
  27. def __init__(self,name, age, cruelty):
  28. self.name = str(name)
  29. self.age = int(age)
  30. self.iq = int(cruelty)
  31.  
  32. def produce_sound(self):
  33. print("I'm a Sophistisnake, and I will now produce a sophisticated sound! Honey, I'm home.")
  34.  
  35.  
  36. all_the_fucking_animals = []
  37. while True:
  38. data = input()
  39. if data == "I'm your Huckleberry":
  40. break
  41. meta_data = data.split()
  42.  
  43. if meta_data[0] == "Dog":
  44. dog_name = meta_data[1]
  45. age = meta_data[2]
  46. limbs = meta_data[3]
  47. dog = Dog(dog_name,age,limbs)
  48. all_the_fucking_animals.append(dog)
  49. elif meta_data[0]=="Cat":
  50. cat_name = meta_data[1]
  51. age = meta_data[2]
  52. iq = meta_data[3]
  53. cat = Cat(cat_name, age, iq)
  54. all_the_fucking_animals.append(cat)
  55. elif meta_data[0] == "Snake":
  56. snake_name = meta_data[1]
  57. age = meta_data[2]
  58. cruelty = meta_data[3]
  59. snake = Snake(snake_name, age, cruelty)
  60. all_the_fucking_animals.append(snake)
  61. if meta_data[0] == 'talk':
  62. name = Animal(meta_data[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement