Overriding
class ParentClass:
def print\_self(self):
print("Parent")
class ChildClass(ParentClass):
def print\_self(self):
print("Child")
child_instance = ChildClass()
child_instance.print_self() # => Child
Comments
class ParentClass:
def print\_self(self):
print("Parent")
class ChildClass(ParentClass):
def print\_self(self):
print("Child")
child_instance = ChildClass()
child_instance.print_self() # => Child