Single Inheritance Example in Python

8 / 100 SEO Score
class Base:
def geta(self):
return 10
def getb(self):
return 20
class Derived(Base):
def sum(self):
print(self.geta()+self.getb())
d=Derived()
d.sum()

Leave a Reply

Your email address will not be published. Required fields are marked *