Understanding the importance of modifying the order of inheritance
In this section, we will look at inheriting from more than one parent class. We will see what happens to the method resolution when the order of the parent class changes in addition to the SendStoreCoupon
class that was created in the preceding section:
- First, we will be creating another class, named
ManufacturerCoupon
, where we will be defining attributes for a manufacturer such as the product name, product category, brand of the product, manufacturer name where the product is sold, expiry date of the product, and quantity to be purchased to get a coupon. - We will then define a method named
generate_coupon
, where we will be generating two coupons for the product with random coupon ID values and all the details of the product and its manufacturer:class ManufacturerCoupon: productName = "Strawberry Ice Cream" product_category = "Desserts"...