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 trialAndrew Bickham
1,461 Pointsdef praise
i keep getting "You forgot the self
argument in your praise
method" which i don't quite understand
class Student:
name = "andrew"
def praise(self):
y = "good job"
x = "{} {}".format(y, self.name)
if self.name == "andrew":
return x
teacher = Student()
teacher.praise()
2 Answers
Steven Parker
231,269 PointsYour method currently returns the string only if the name is "andrew".
But it should always return the message, no matter what the name is set to!
KRIS NIKOLAISEN
54,971 PointsRemove the if statement. If the checker changes the name your praise method returns None which may be the cause of failure. Could be something else. But it is a good idea to do just what the challenge asks and no more.
Andrew Bickham
1,461 PointsAndrew Bickham
1,461 Pointsthank you guys, my apologies i miss read the question