Write a program that shows how child class can access the init method of the parent class using super


Topic: Write a program that shows how child class can access the init method of the parent class using super

Solution

class A:
    def __init__(self):
        print("My name is GYOBU MASATAKA ONIWA!")
class B(A):
    def __init__(self):
        super(B, self).__init__()
        print("as I breath, you WILL not pass the castle gates!")
tmp = B()



List all Python Programs