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

Roniel Flores
Roniel Flores
821 Points

omg this is simple but can't figure it out

what am I doing wrong

first_class.py
class Student:
    name = "Roniel Flores"
      pass  
    me = student()
Roniel Flores
Roniel Flores
821 Points

I tried it, it does not work :/

1 Answer

Steven Parker
Steven Parker
229,732 Points

It looks like you passed task 1.

But then...

  • remember how Python uses indentation. If you indent the lines below your class, Python will think that they are supposed to be part of the class.
  • you won't need to use "pass" here
  • remember that Python is case sensitive — "student" is not the same thing as "Student"
  • creating "me" is only part of task 2. Remember you also need to print something

Hopefully these hints will get you going again.

Roniel Flores
Roniel Flores
821 Points

print something? how would that show in the page?

Steven Parker
Steven Parker
229,732 Points

The last part of task 2 is "Then print() out the name attribute of your instance." So you would have the function name, and the argument in parentheses would be the name attribute of your new object.