Python Object-Oriented Python Instant Objects Your first class

Sinazo Nongena
Sinazo Nongena
2,468 Points

Now, create a variable named me and assign it an instance of Student(). Then print() out the name attribu

Please assist

first_class.py
class Student:
    name = "Sinazo"

    me = Student()
    print(me.name)

1 Answer

Ave Nurme
Ave Nurme
19,627 Points

Hi Sinazo

You just have a small indentation issue here. You need to indent correctly like this...

class Student:
    name = "Sinazo"

me = Student()
print(me.name)

...and you should pass the challenge just fine :-)