Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SuperClass
- class Clothing( ):
- def wear(self):
- return "I'm wearing this fashionable piece of clothing!"
- def sell(self):
- return "Buy my piece of clothing"
- #SubClass
- class Socks(Clothing):
- def lose_one(self):
- return "Where did my other one go?"
- def wear(self):
- return "Take a look at my socks! They're gorgeous!"
- def sell(self):
- return "Buy my socks!"
- #Testing
- clean_socks = Socks()
- print(clean_socks.wear())
- print(clean_socks.lose_one())
- print(clean_socks.sell())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement