[Tutor] (no subject)
Steven D'Aprano
steve at pearwood.info
Sat Mar 16 05:14:33 EDT 2019
Hi Glenn, and welcome.
On Fri, Mar 15, 2019 at 09:54:41PM -0400, 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)
>
> I entered this in IDLE and it failed. Any advice? Thank you.
Yes -- read the error message. What does it say?
(Reading, and understanding, error messages is probably the most
important skill a programmer can have.)
--
Steven
More information about the Tutor
mailing list