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

this is class task

wtf im not know how to do this

first_class.py
class Student:
    name = "Bartek"
    def praise(self):
        print(name)

1 Answer

Brandon White
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Full Stack JavaScript Techdegree Graduate 35,771 Points

Hi Bartek,

You’re really close here. Two things you’ll want to change.

The first is name is not defined within the praise function, but it will be a property of the self object that is passed into the function. And so you’ll need to retrieve it as a property of self (i.e. self.name).

The second thing is the challenge asks you to return a phrase (i.e. a string), but you’re printing it to the console and returning nothing.

Fix those two things, and you will pass the challenge.