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

Martina Vonkomerova
Martina Vonkomerova
7,790 Points

I am really struggling on the second task to this challenge, could someone please walk me through it?

I have repeatedly watched the videos and still I can not get my head around this question. I am not sure of what it is asking me to do.

It is asking you to create an instance of that class, store that object in a variable named me, and then print the name of that instance.

For example:

class myExample:
    name = 'my name'

person = myExample() #this is an instance of the class myExample, stored to the variable `person` 
print(person)

1 Answer

Steven Parker
Steven Parker
231,248 Points

Always post your code along with a question. At least post what you did for task 1, then make a "good faith" attempt at task 2 and post that with it.