This Python program defines a class named Instructor that stores key information about an instructor.
The class includes the following fields:
- Instructor ID
- Last Name
- Teaching System
- Payment per session (or per hour)
This structure is useful for managing instructor records in educational platforms or payroll systems.
# Define the Instructor class
class Instructor:
def __init__(self, instructor_id, last_name, system, payment):
self.instructor_id = instructor_id
self.last_name = last_name
self.system = system
self.payment = payment
def display_info(self):
print("Instructor ID:", self.instructor_id)
print("Last Name:", self.last_name)
print("Teaching System:", self.system)
print("Payment per session:", self.payment)
# Create an Instructor object
i = Instructor("T-102", "Variom", "Online", 250)
# Display instructor information
i.display_info()
Instructor ID: T-102
Last Name: Variom
Teaching System: Online
Payment per session: 250
- The Instructor class is initialized with four fields
- display_info() prints all stored values in a readable format
- This structure can be extended to include more attributes like subjects, contact info, or availability