To properly create a new Student
object using the provided class definition, you need to pass the correct arguments to the Student
constructor (__init__
method). The constructor requires three arguments: name
, gpa
, and grade
.
Here’s a breakdown of the options provided:
s1 = Student(self, “Jorge”, 3.4, 12)
– Incorrect.self
should not be passed when creating an instance of the class.s1 = Student(self, “Jorge”, 3.4, 12)
– Incorrect (same as above).s1 = Student(“Jorge”, 3.4, 12)
– Correct. This properly provides the expected arguments.s1 = Student(3.4, “Jorge”, 12)
– Incorrect. The order of arguments is not correct.s1 = Student(“Jorge”, 12)
– Incorrect. This does not provide enough arguments since thegpa
argument is missing.
The correct response is:
s1 = Student(“Jorge”, 3.4, 12)