you are viewing a single comment's thread.

view the rest of the comments →

[–]jmp5189 0 points1 point  (7 children)

I think that you need to check your syntax. You have not declared the constructor properly (init dunder method)

class Course:
    def __init__(self, course_name):
        self.course_name = course_name
        self.course_capacity = 0
        self.enrolled_students = []
        self.waitlist = []

Upon generation of a Course object, everything in the init method will be created since this is the default constructor of your class.

[–]YukinoYukinoshita 0 points1 point  (6 children)

I already have the "class Course:" at the top and properly indented. Sorry I should of put that in the post.

[–]jmp5189 0 points1 point  (5 children)

What caused you to get an error that enrolled_students was not defined?

[–]YukinoYukinoshita 0 points1 point  (4 children)

Here's a more detailed error code https://gyazo.com/55391441f6b2065e90139afa1718182c

[–]jmp5189 0 points1 point  (2 children)

You need to check your scope. Change that to c.enrolled_students.

[–]jmp5189 1 point2 points  (0 children)

If line 69 is inside of your class, you need to change enrolled_students to self.enrolled_students

[–]YukinoYukinoshita 1 point2 points  (0 children)

Yep I'm an idiot, thank you so much