In this we are going to see a program about Parameterized super Constructor in Inheritance Constructor in Python – 1 in Python Programming Language.
class Sum:
def __init__(self, a, b):
self.a = a
self.b = b
def sum(self):
print(self.a+self.b)
class baseSum(Sum):
def __init__(self, a, b):
self.a = a
self.b = b
super().__init__(self.a, self.b)
p = baseSum(5, 6)
p.sum()
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP