Single Inheritance:
When a class inherits the properties of another class, it is known as single inheritance.
![Python | Single Inheritance](https://www.includehelp.com/python/images/single-inheritance-2.jpg)
The class that inherits the properties of another class is known as derived Class.
The class whose properties are inherited is known as base Class.
Classes used in the program:
- Class : Employee
- Method : getEmployeeInfo() : Gets input of the employee information from the user.
- Method : printEmployeeInfo() : prints the information of the employee.
- Method : getSalary() : return the salary of the employee.
- Class Perks :
- Method: getPerks() : calculates all perks of the employee.
- Method : putPerks() : prints all perks and employee details of the employee.
Program to illustrate single inheritance in Python
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer