« All Events
7 PM – Python OOP
October 1, 2021 @ 7:00 pm - 8:00 pm
Homework
- Add a new python file under “src” folder: teacher.py
- Inside teacher.py, create a new class “Teacher” with the following attributes: name, age, phone, subject.
- Inside school_application.py add two more features: Add New Teacher and List All teachers. These 2 features are very similar to Add new student and List all students. Look at below examples
-
Please select one of the following
1. Add new student
2. List all students
3. Find student
4. Quit
5. Add new teacher
6. List all teachers
Enter your selection: 5
Add a new teacher:
Enter teacher name: Gamas Chang
Enter teacher age: 100
Enter teacher phone: 888-888-8888
Enter teacher subject of expertise: Python
You have successfully added a new Teacher: Gamas Chang
Please select one of the following
1. Add new student
2. List all students
3. Find student
4. Quit
5. Add new teacher
6. List all teachers
Enter your selection: 5
Add a new teacher:
Enter teacher name: John Cheng
Enter teacher age: 99
Enter teacher phone: 999-999-9999
Enter teacher subject of expertise: Java
You have successfully added a new Teacher: John Cheng
Please select one of the following
1. Add new student
2. List all students
3. Find student
4. Quit
5. Add new teacher
6. List all teachers
Enter your selection: 6
Gamas Chang - 100 years old - subject of expertise: Python
John Cheng - 99 years old - subject of expertise: Java