Created
August 25, 2022 06:27
-
-
Save codephillip/f4f4d4267469ee78ef4697e98b67da15 to your computer and use it in GitHub Desktop.
classroom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class School: | |
def __init__(self, name, location): | |
self.name = name | |
self.location = location | |
class Student: | |
def __init__(self, name, age, school): | |
self.name = name | |
self.age = age | |
self.school = school | |
class Teacher: | |
def __init__(self, name, qualification, school): | |
self.name = name | |
self.qualification = qualification | |
self.school = school | |
class Classroom: | |
def __init__(self, classnumber, teacher): | |
self.classnumber = classnumber | |
self.teacher = teacher | |
self.students = [] | |
def add_student(self, student): | |
self.students.append(student) | |
def delete_student(self, name): | |
for student in self.students: | |
if student.name == name: | |
self.students.remove(student) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment