Question: Please solve using python Question: 3 Implement the design of the Student_Tutor class that inherit from Student class so that the following code generates the
Please solve using python
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 rafid.
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 rafid:",Student_Tutor.student_rafid)
OUTPUT: Name: Reem Student_ID: 18101235 Current Semester: Spring 2022 1.===================================== 2.===================================== Student Tutor's Details: Name: Moynul Student_ID: 16107892 Current Semester: Spring 2022 Tutor_ID: 35 Courses: CSE110, CSE111 You'll find Moynul in room no. 1 during the consultation hours. 3.====================================== Student Tutor's Details: Name: Priyo Student_ID: 16107792 Current Semester: Spring 2022 Tutor_ID: 25 Courses: CSE320 You'll find Priyo in room no.1 during the consultation hours. 4.====================================== Student Tutor's Details: Name: Ronok Student_ID: 18207892 Current Semester: Spring 2022 Tutor_ID: 36 Courses: CSE110, CSE111, CSE221, CSE220 You'll find Ronok in room no. 2 during the consultation hours. 5.====================================== Student Tutor's Details: Name: Zeba Student_ID: 19307892 Current Semester: Spring 2022 Tutor_ID: 48 Courses: CSE110 You'll find Zeba in room no. 2 during the consultation hours. 6.====================================== Number of Student rafid: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
