Advertisement
Blessing988

Untitled

Mar 29th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #SuperClass
  2.  
  3. class Clothing( ):
  4.  
  5.     def wear(self):
  6.         return "I'm wearing this fashionable piece of clothing!"
  7.  
  8.     def sell(self):
  9.         return "Buy my piece of clothing"
  10. #SubClass
  11.  
  12. class Socks(Clothing):
  13.  
  14.     def lose_one(self):
  15.         return "Where did my other one go?"
  16.  
  17.     def wear(self):
  18.         return "Take a look at my socks! They're gorgeous!"
  19.  
  20.     def sell(self):
  21.         return "Buy my socks!"
  22.  
  23. #Testing
  24. clean_socks = Socks()
  25. print(clean_socks.wear())
  26. print(clean_socks.lose_one())
  27. print(clean_socks.sell())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement