Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fruit:
- def eat(self):
- print("You ate the "+self.get_name())
- def get_name(self):
- return "unknown fruit"
- class Apple(Fruit):
- def get_name(self):
- return "apple"
- a = Apple()
- a.eat()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement