Python Object-Oriented Python Instant Objects Your first class

Scott Rivers
Scott Rivers
1,341 Points

says create a variable named me and assign to an instance named student, what am i doing wrong

class Student: name = "scott" me = Student()

print(name)
first_class.py
class Student:
    name = "scott"
    student() = me

    print(name)
Curtis Nouchi
seal-mask
.a{fill-rule:evenodd;}techdegree
Curtis Nouchi
Python Development Techdegree Student 2,463 Points

Hi Scott!
name is the variable you want to print, so based on the info here, you don't need the student() = me, or the class Student code. Hope that helps or answers!

1 Answer

Rick Gleitz
Rick Gleitz
39,483 Points

Hi, Scott, The variable and print statements need to be outside the class, so don't indent them. And remember that when we declare a variable, whatever is on the right is what is stored in the variable, which is on the left (in other words, you reversed the variable statement). Also, to get the print statement to work, it needs to be me.name so it can access the student instance, which will access the class. Hope this helps!