Question: Exercise 1 [Student Class] Create a class called student. It should have fields for name, id and a list of tuples (course, grade) for all

 Exercise 1 [Student Class] Create a class called student. It should

Exercise 1 [Student Class] Create a class called student. It should have fields for name, id and a list of tuples (course, grade) for all courses the student has taken. Be sure to include an _init_method to initialize it with the three field values. Add a_str_method that returns a string representation of a student object in a simple way. For example, you create a student object as follows: s = Student ( 'cat', 123, [ ('comp1405', 78), ('comp1805', 87)] ) Exercise 2 [Accessing Student Data] Write a function called computeAverage(student) that takes a Student object as input and returns the average of all the courses the student has taken. If the student has not taken any courses, it returns -1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!