What does super do in Python?
In a class hierarchy with single inheritance, super can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely parallels the use of super in other programming languages.
class A(object): def __init__(self, profession): print(profession) class B(A): def __init__(self): print('John Doe') super().__init__('Developer') b = B()
Sample output of above program.
John Doe Developer
2019-07-08T10:36:54+05:30
2019-07-08T10:36:54+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution