Python Super() function
Published February 17, 2022Inheritance is one of the most essential OOP elements in Python. Inheritance is the process through which one class inherits one or more behaviours from another.
When one class inherits the behaviour of another, the inherited class becomes the subclass, while the original class becomes the parent class. The super() method is used to refer to the parent class in an inherited class. The super() function returns the superclass's temporary object, which gives access to all methods of its child class.
Take a look at the following example:
Example of a super() Function
class Student(object): |
Output
Name of the College: University of Hull |
Article Contributed By :
|
|
|
|
222 Views |