Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python Instant Objects Your first class

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
47,239 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!