uestion: 3 Implement the design of the Student_Tutor class that inherit from Student class so that the following code generates the output below: Hint: Each room has a capacity of 2 Student tutors. class Student: def __init__(self,name,student_id): self.name = name self.student_id = student_id self.semester = "Spring 2022" def details(self): print("Name:",self.name) print("Student_ID:",self.student_id) print("Current Semester:",self.semester) # Write your code here: STs = [] S1 = Student("Reem", 18101235) S1.details() print("1.======================================") ST1 = Student_Tutor("Moynul", 16107892, 35, "CSE110", "CSE111") ST2 = Student_Tutor("Priyo", 16107792, 25,"CSE320") ST3 = Student_Tutor("Ronok", 18207892, 36, "CSE110", "CSE111", "CSE221", "CSE220") ST4 = Student_Tutor("Zeba", 19307892, 48, "CSE110") STs.extend([ST1, ST2, ST3, ST4]) print("2.======================================") for i in range(len(STs)): STs[i].details() print(f"{i+3}.==========================
Question: 3
Implement the design of the Student_Tutor class that inherit from Student
class so that the following code generates the output below:
Hint: Each room has a capacity of 2 Student tutors.
class Student:
def __init__(self,name,student_id):
self.name = name
self.student_id = student_id
self.semester = "Spring 2022"
def details(self):
print("Name:",self.name)
print("Student_ID:",self.student_id)
print("Current Semester:",self.semester)
# Write your code here:
STs = []
S1 = Student("Reem", 18101235)
S1.details()
print("1.======================================")
ST1 = Student_Tutor("Moynul", 16107892, 35, "CSE110", "CSE111")
ST2 = Student_Tutor("Priyo", 16107792, 25,"CSE320")
ST3 = Student_Tutor("Ronok", 18207892,
36, "CSE110", "CSE111", "CSE221", "CSE220")
ST4 = Student_Tutor("Zeba", 19307892, 48, "CSE110")
STs.extend([ST1, ST2, ST3, ST4])
print("2.======================================")
for i in range(len(STs)):
STs[i].details()
print(f"{i+3}.======================================")
print("Number of Student Tutors:",Student_Tutor.student_tutors)
Step by step
Solved in 4 steps with 3 images