Question

Consider this program:

class Students:

def __init__(self, name, grade):

self.name = name

self.grade = grade



student34 = Students("Maria", 10)

student35 = Students("Jane", 9)

print(student35.grade)

What is the output?

(1 point)
Responses

10

10

9

9

Jane

Jane

student35

student35
Skip to navigation

1 answer

The program defines a Students class with an __init__ method that initializes a student's name and grade.

The following lines create two instances of the Students class:

student34 = Students("Maria", 10)
student35 = Students("Jane", 9)

When print(student35.grade) is executed, it outputs the grade attribute of the student35 instance, which has been set to 9.

Therefore, the output of the program is:

9