15 Apr Tuesday 7:30 Python Practice – 22.04.12.
Question:
- Create a Python class Person with attributes: name and age of type string.
- Create a display() method that displays the name and age of an object created via the Person class.
- Create a child class Employee which inherits from the Person class and which also has two attributes position and salary.
- Create a method displayEmpolyee() that displays the name, age, position and salary of an object created via the Employee class.
- Create a employee object via an instantiation on the Employee class and then test the displayEmpolyee() method.
Sorry, the comment form is closed at this time.