Guest User

Untitled

a guest
Jul 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. class animal:
  2. weight = 5
  3. height = 10
  4. food = None
  5.  
  6. def give_food(self, value):
  7. self.weight += value
  8.  
  9.  
  10. class cow(animal):
  11. name = 'Manka'
  12. weight = 70
  13. height = 150
  14. voice = 'Manka say Muuu'
  15.  
  16. def take_milk(self):
  17. self.weight -= 69.3
  18. print(self.voice, 'Now we have', self.weight, 'gramm of milk!')
  19.  
  20.  
  21. class goose_1(animal):
  22. weight = 47
  23. height = 76
  24. name = "Grey"
  25. voice = 'Grey Goose say Shhhhhhh'
  26.  
  27. def goose_1_voice(self):
  28. print(self.voice)
  29.  
  30.  
  31. class goose_2(goose_1):
  32. weight = 79
  33. height = 34
  34. name = 'White'
  35. voice = 'White Goose say Shhhhhhh'
  36.  
  37. def goose_2_voice(self):
  38. print(self.voice)
  39.  
  40.  
  41. class sheep_1(animal):
  42. name = 'Sheepy'
  43. weight = 67
  44. height = 50
  45. voice = 'Sheepy say "Beee"'
  46.  
  47. def fur(self):
  48. self.weight -= 63
  49. print(self.voice, 'Now we have', self.weight, 'kg of fur!')
  50.  
  51.  
  52. class sheep_2(sheep_1):
  53. voice = 'Curly say Yeeeehhh'
  54.  
  55. def fur(self):
  56. self.weight -= 60
  57. print(self.voice, 'Now we have', self.weight, 'grams of fur!')
  58.  
  59.  
  60. class chicken_1(animal):
  61. name = 'Koko'
  62. weight = 20
  63. height = 15
  64. voice = 'Kokoko'
  65.  
  66. def take_eggs(self):
  67. self.weight -= 3
  68. print('Koko said', self.voice, 'We took', self.weight, 'of eggs')
  69.  
  70.  
  71. class chicken_2(chicken_1):
  72. name = 'Kukareku'
  73. voice = "Kokokokoko"
  74.  
  75. def take_eggs(self):
  76. self.weight -= 5
  77. print(self.name, self.voice, 'We have', self.weight, 'of eggs')
  78.  
  79.  
  80.  
  81. Cow = cow()
  82. Cow.take_milk()
  83. goose_1 = goose_1()
  84. goose_1.goose_1_voice()
  85. goose_2 = goose_2()
  86. goose_2.goose_2_voice()
  87. sheep_1 = sheep_1()
  88. sheep_1.fur()
  89. sheep_2 = sheep_2()
  90. sheep_2.fur()
  91. chicken_1 = chicken_1()
  92. chicken_1.take_eggs()
  93. chicken_2 = chicken_2()
  94. chicken_2.take_eggs()
Add Comment
Please, Sign In to add comment