This video will tell you about Inheritance in Python with example in detail
Below is the python code:
class Person:
def displayName(self):
print("displaying name")
def displayGender(self):
print("displaying gender")
def displayAddress(self):
print("displaying address")
class Student(Person):
def attendingClass(self):
print("attending class")
class Teacher(Person):
def takingClass(self):
print("taking class")
student=Student()
student.displayName()
student.displayGender()
student.displayAddress()
student.attendingClass()
teacher=Teacher()
teacher.displayName()
teacher.displayGender()
teacher.displayAddress()
teacher.takingClass()
Music: https://www.bensound.com