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

Michael Kaminski
Michael Kaminski
1,419 Points

I keep getting an error when I try to make a class called Student and an instance called me. Please help!

The instructions state: Now, make an instance of your class named me. Then print() out the name attribute of your instance.

I make a class called Student and then put in name="me", and then when I print it, I get an error saying it couldn't find me. I don't get it. Can someone give me a hint please?

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

2 Answers

Scott Bailey
Scott Bailey
13,190 Points

The question is asking you to create an instance of the class Student - called "me"

me = Student()

This creates a new instance of Student called "me"

From there have a go at print the "name" of the new student (me)

Hi Michael,

It looks like it's asking you to create a class called Student, with your name as a string in the name attribute. After that, it wants you to create an instance of Student called

me = Student()

Then you can print with

print(me.name)