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 method

I did not forget the 'self' argument in my 'praise' method

Code attached, I hope

3 Answers

ThatOneCoder -
ThatOneCoder -
9,310 Points

Well I can't see your code but I know the answer. A common mistake in this challenge is thinking to put the message in the varible name but you are supposed to put your name into there and return the message with the name formatted. Here is my code:

class Student: def praise(self): name = "Ismael" return("You're doing a great job {}!".format(self.name))

I attached my code by ticking the box on the form, but it didn't work. The code I wrote worked fine in my own console. Here's what I wrote:

class Student: name = "Leslie" def praise(self): print("You're doing fine, {}".format(self.name))

I have repeated problems with Treehouse's workspace. Fortunately I'm not taking this course for credit, so the only problem is that I get annoying messages telling me I haven't completed the exercises.

ThatOneCoder -
ThatOneCoder -
9,310 Points

Well now looking at your code you are correct but the question asked you to return the message instead of printing it. I hope this helps!