Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
42,986 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!