In this we are going to see a basic program to get variables using single inheritance in Python Programming Language.
class Test:
def __init__(self,x):
self.x = x
class Derived_Test(Test):
def __init__(self,x,y):
super().__init__(x)
self.y = y
def main():
b = Derived_Test(3,4)
print(b.x,b.y)
main()
# Coded By Dhiraj Shelke
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP