class A: def function(self): print("function() method from class A") class B(A): def function(self): super().function() # calling the parent class function() method print("function() method from class B") b_obj = B() b_obj.function()