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

Jorge Grajeda
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jorge Grajeda
Python Development Techdegree Graduate 8,186 Points

Object Orientation

I am having trouble with this challenge, I know there's something missing but I can't figure out what. Help please.

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

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Hey Jorge Grajeda, you are closer than you think.

  • the me assignment is indented too far and is being interpreted as part of the class definition. Remove the indentation from the assignment.
  • the print also needs the indentation removed. Plus, print is a function, it needs the printed object inside parens
  • since the name is an attribute of me, it can be referenced using me.name

Post back if you need more help. Good luck!!!