Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Codelab help!! PYTHON! There is a class called Roster whose constructor takes a

ID: 3934665 • Letter: C

Question

Codelab help!! PYTHON!

There is a class called Roster whose constructor takes a List of tuples with the names of students and their grades in the class, for example -- [('Richard', 98), ('Benny', 55), ('Katie', 87), ('Sally', 76)].
Create an instance of the Roster class, including the following students and their respective grades, and store it in the variable  mathClass: Jacob, 65 Frankie, 86 Lina, 94 Arnold, 63 Amanda, 87

What I have so far:

mathClass= Roster.append[('Richard', 98), ('Benny', 55), ('Katie', 87), ('Sally', 76)]

Explanation / Answer

class Roster(object): def __init__(self, students): self.students = students mathClass = Roster([("Jacob", 65), ("Frankie", 86), ("Lina", 94), ("Arnold", 63), ("Amanda", 87)])