Python super() Function
Use the super() Function
Python also has a super() function that
will make the child class inherit all the methods and properties from its
parent:
Example
class Student(Person):
def __init__(self, fname, lname):
super().__init__(fname, lname)
Try it Yourself »
def __init__(self, fname, lname):
super().__init__(fname, lname)
By using the super() function, you do not
have to use the name of the parent element, it will automatically inherit the
methods and properties from its parent.
Related Pages
Python Inheritance Tutorial Inheritance Create Parent Class Create Child Class Create the __init__() Function Add Class Properties Add Class Methods