Skip to main content

/docs/images/banner.jpg

Python

Method Overriding

Title: WAP to show method overriding in python

# WAP to show method overriding in python

class A:
def show(self):
print("Class A")


class B(A):
def show(self):
print("Class B")


b = B()
b.show()
# Output:
# Class B