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 trialRoniel Flores
821 PointsIs this correct?
how do I pass this part, am I doing it mostly correct?
import random
class Student:
name = "Roniel Flores"
def praise(self)
return bool(random.randint(0, 1))
print("You're doing a great job, Jacinta")
2 Answers
john larson
16,594 PointsHi Roniel, here are some hints.
# I need you to add a method name praise.
def praise(self) # this is missing a :
# name was here?
return bool(random.randint(0, 1)) <-- this doesn't belong here, it's not part of the challenge
print("You're doing a great job, Jacinta") <-- which includes the name attribute.
# be sure to return not print
# the name attribute seems to be missing
john larson
16,594 PointsHi Roniel, To return something instead of printing it use:
return "You're doing a great job, Jacinta"
Roniel Flores
821 PointsRoniel Flores
821 Pointshow do I return not print?
class Student: name = "Roniel Flores" praise (self): print("You're doing a great job, Jacinta")