What is Function Overriding Or Runtime Polymorphism in python?.

class Base:
a=10
def geta(self):
return self.a
def getb(self):
return 20
class Derived1(Base):
def geta(self):
return 100
def sum(self):
return(self.geta()+self.geta()+self.getb())
d1=Derived1()
print(d1.sum());

Leave a Reply

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