fork download
  1. from abc import ABCMeta
  2. class Product(metaclass=ABCMeta):
  3. def return_policy(self):
  4. print("From Base Class")
  5.  
  6. class Furniture(Product):
  7. pass
  8.  
  9. class Mobile(Product):
  10. def return_policy(self):
  11. print("All mobiles must be returned within 10 days of purchase")
  12.  
  13. class Shoe(Product):
  14. def return_policy(self):
  15. print("All shoes must be returned within 7 days of purchase")
  16.  
  17. s=Furniture()
  18. s.return_policy()
  19.  
Success #stdin #stdout 0.02s 9048KB
stdin
Standard input is empty
stdout
From Base Class