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

Am I doing something wrong?

I am on the second part of this challenge and I do not understand the instance part of it I am on the YOUR FIRST CLASS assignment

first_class.py
class Student:
    name = 'gabriel'
    me = Student()
    me.name
    print(name)

1 Answer

Hi Gabriel,

You’re off to a good start, but right now you have all of your code nested within the class definition.

You’ll want to move the statement where you create an instance of your class to outside of the class definition. You’ll need to outdent(?)/or un-indent.

Then you’ll call the me.name like you’re already doing on line four, you’ll just want to pass that as an argument into the print function.

You’re currently passing the variable name (which is undefined outside of the class/class instance) into the print function, and that will result in an error.

thank you so much its out dent by the way