[Tutor] (no subject)

Tobiah toby at tobiah.org
Mon Mar 18 11:34:02 EDT 2019


You need a space between 'def' and '__init__'.
Then you must remove the import statement.  The class
is already defined in your scope and there is no
module called 'Student'.


Tobiah

On 3/15/19 6:54 PM, Glenn Dickerson wrote:
> class Student():
> 
>      def__init__(self, name, major, gpa, is_on_probation):
>          self.name = name
>          self.major = major
>          self.gpa = gpa
>          self.is_on_probation = is_on_probation
> 
> 
> import Student
> student1 = Student('Jim', 'Business', 3.1, False)
> student2 = Student('Pam', 'Art', 2.5, True)
> print(student1.name)
> print(student2.gpa)




More information about the Tutor mailing list