Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class product:
- def __init__(self,nam,prc):
- self.name=nam
- self.price=prc
- def get_name(self):
- return self.name
- def get_price(self):
- return self.price
- class gift(product):
- def __init__(self,nam,prc,wrp):
- super().__init__(nam,prc)
- self.wrpp = wrp
- def get_price(self):
- return self.price + self.wrpp
- g1 = gift('hell',1000,100)
- print(g1.get_price())
- p1 = product('gh',1000)
- print(p1.get_price())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement