OOP Assignment
OOP Assignment
Objective:
Instructions:
1. Write the code in Python (or the language you are teaching).
2. Submit your code with appropriate comments.
3. Each task should be implemented as a separate class or function.
Tasks:
- Create another derived class `Teacher` from `Person`. Add the following attributes:
- `employee_id` (string)
- `subject` (string)
- Add a method `display()` to the `Teacher` class that overrides the base class method and
displays all the attributes.
- Write a function `show_details(person: Person)` that accepts an object of type `Person` and calls
its `display()` method.
Task 3: Handle Exceptions
Bonus Task:
- Create a small program that demonstrates how all the concepts (inheritance, polymorphism, and
exception handling) can work together.