Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started