Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fruit(Object):
- _keyword = None
- def use(self):
- if self._keyword == 'tasty':
- print('Close your eyes and enjoy the flavour')
- else:
- print('Shut up and eat')
- class Orange(Fruit):
- _keyword = 'tasty'
- class Banana(Fruit):
- _keyword = 'Not too tasty'
- class Coconut(Fruit):
- _keyword = 'Hard'
- def use(self):
- print('This thing is {}, Smash someone's head'.format(self._keyword))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement