Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class animal:
- weight = 5
- height = 10
- food = None
- def give_food(self, value):
- self.weight += value
- class cow(animal):
- name = 'Manka'
- weight = 70
- height = 150
- voice = 'Manka say Muuu'
- def take_milk(self):
- self.weight -= 69.3
- print(self.voice, 'Now we have', self.weight, 'gramm of milk!')
- class goose_1(animal):
- weight = 47
- height = 76
- name = "Grey"
- voice = 'Grey Goose say Shhhhhhh'
- def goose_1_voice(self):
- print(self.voice)
- class goose_2(goose_1):
- weight = 79
- height = 34
- name = 'White'
- voice = 'White Goose say Shhhhhhh'
- def goose_2_voice(self):
- print(self.voice)
- class sheep_1(animal):
- name = 'Sheepy'
- weight = 67
- height = 50
- voice = 'Sheepy say "Beee"'
- def fur(self):
- self.weight -= 63
- print(self.voice, 'Now we have', self.weight, 'kg of fur!')
- class sheep_2(sheep_1):
- voice = 'Curly say Yeeeehhh'
- def fur(self):
- self.weight -= 60
- print(self.voice, 'Now we have', self.weight, 'grams of fur!')
- class chicken_1(animal):
- name = 'Koko'
- weight = 20
- height = 15
- voice = 'Kokoko'
- def take_eggs(self):
- self.weight -= 3
- print('Koko said', self.voice, 'We took', self.weight, 'of eggs')
- class chicken_2(chicken_1):
- name = 'Kukareku'
- voice = "Kokokokoko"
- def take_eggs(self):
- self.weight -= 5
- print(self.name, self.voice, 'We have', self.weight, 'of eggs')
- Cow = cow()
- Cow.take_milk()
- goose_1 = goose_1()
- goose_1.goose_1_voice()
- goose_2 = goose_2()
- goose_2.goose_2_voice()
- sheep_1 = sheep_1()
- sheep_1.fur()
- sheep_2 = sheep_2()
- sheep_2.fur()
- chicken_1 = chicken_1()
- chicken_1.take_eggs()
- chicken_2 = chicken_2()
- chicken_2.take_eggs()
Add Comment
Please, Sign In to add comment