Top Of The Course
Top Of The Course
Write two classes from scratch. Student(name, grades) stores name and grades (a list of floats) and has average() returning sum(self.grades) / len(self.grades). Course(code) does not inherit from Student; it stores code and an empty list attribute students. enrol(student) appends a Student; class_average() returns the mean of every enrolled student's average(); top_student() returns the name of the student with the highest average, keeping the best seen so far while looping. Do NOT write a main block or any top-level test code; the tests construct the class. Input: two lines, a name and then grades separated by spaces, which the tests read (the grades as floats) and enrol as a third student after Maya (88, 92, 75) and Omar (60, 70, 80, 90); they then print how many students are enrolled, the class average and the top student's name on separate lines.
Expected Output:
3 85.0 Noor
= newline. The output ends with a newline — print one after the last line.
Your Output
Run your code to see the output here...