In this program, we have a parent class named Details and two child classes named Employee and Doctor, we are inheritance the class Details on the classes Employee and Doctor. And, finally creating two objects of Employee and Doctor classes and setting, showing the values using their methods.
Python code to demonstrate example of single inheritance with two child classes
Output
need an explanation for this answer? contact us directly to get an explanation for this answer