Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PySuper
#python 3.6.9 #PySuper #this code is created by Rezaul Hoque on January 05,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; class Fruit: def __init__(self,fruit, color, price, qty): self.fruit= fruit self.color= color self.price = price self.qty = qty def cost(self): return self.price*self.qty class Mango(Fruit): def __init__(self, fruit,color,price,qty,charge): super().__init__(fruit,color,price,qty) self.charge= charge def cost(self): return super().cost() + self.charge if __name__ == '__main__': m = Mango('Khirsapati','Green',50,1,20) print(m.cost())
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Lakshya
PyRegGreed
31 dec
pyEnumAuto
oppo mobile
sai hw user enter table
😚😚😚
haha
Game3
list_copy_shallow_deep.py
Please log in to post a comment.