QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12A-2016-B02E #6297

Question:

What is the significance of super() method? Give an example for the same.

Answer:

super() function is used to call base class methods which has been extended in
derived class.
EX:

class GradStudent(Student):
    def _init__(self):
        super(GradStudent, self).__init__()
        self.subject = ""
        self.working = ""
    def readGrad (self):
    # Call readStudent method of parent class
    super(GradStudent, self).readStudent()