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

Jt Miller
Jt Miller
1,242 Points

Not sure what I'm missing here, tells me I'm missing my self argument.

I'm stumped here to my knowledge I've added the self argument to the praise method like instructed, printed out the text but it doesn't even get there it throws the error saying i forgot my self argument.

first_class.py
class Student:
    name = "Jay"

    def praise(self):
        print("Your doing great {}".format(self))
        return

1 Answer

Hi Jt

First of all, as said in the instructions there's no need to print out anything so only a return statement will suffice. So replace print with return. Don't forget to add a space between return and the message.

And secondly, you need to return a message about the student using the name attribute. You can access name like this: self.name. So instead of .format(self) you need to use .format(self.name)

If you make these replacements you should pass the challenge just fine. I tested it out myself.

Hope this helps!