- This event has passed.
6 PM – Python OOP – Gamas
January 18, 2023 @ 6:00 pm - 7:00 pm
Today We Did
- We continue with SchoolSystem project.
- We added find student feature.
Homework
- All files have been added in the google drive. If you were left behind in the class, please download the files from the google drive.
- Continue with SchoolSystem project.
- Create a new python file teacher.py
- Inside this new file, create a new class Teacher with 3 attributes: name, age and subject_of_expertise
- Inside main.py,
- create a new list self.teacher_list. This is very similar to an existing student_list.
- Change the menu to have more features like below
-
Please select one of the following 1. Add new student 2. List all students 3. Find a student by List 4. Add new teacher 5. List all teachers 6. Find a teacher Enter your selection (enter "exit" to quit):
-
- Create a new feature to add new teacher to the list. This is very similar to Add New Student we did in the class.
- Create a new feature to list all teachers. This is very similar to List All students features we did in the class.
- Look at example below
-
Please select one of the following 1. Add new student 2. List all students 3. Find a student by list 4. Add new teacher 5. List all teachers 6. Find a teacher Enter your selection (enter "exit" to quit): 4 ADDING A NEW TEACHER What is your name: Gamas What is your age: 100 What subject do you teach: Python OOP Gamas was successfully added to the system! Please select one of the following 1. Add new student 2. List all students 3. Find a student by list 4. Add new teacher 5. List all teachers 6. Find a teacher Enter your selection (enter "exit" to quit): 4 ADDING A NEW TEACHER What is your name: John What is your age: 99 What subject do you teach: Math John was successfully added to the system! Please select one of the following 1. Add new student 2. List all students 3. Find a student by list 4. Add new teacher 5. List all teachers 6. Find a teacher Enter your selection (enter "exit" to quit): 5 1. Gamas - 100 years old - subject is Python OOP 2. John - 99 years old - subject is Math Please select one of the following 1. Add new student 2. List all students 3. Find a student by list 4. Add new teacher 5. List all teachers 6. Find a teacher Enter your selection (enter "exit" to quit):
-
- Create a new python file teacher.py