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

Roniel Flores
Roniel Flores
821 Points

Is this correct?

how do I pass this part, am I doing it mostly correct?

first_class.py
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

Hi 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
Roniel Flores
Roniel Flores
821 Points

how do I return not print?

class Student: name = "Roniel Flores" praise (self): print("You're doing a great job, Jacinta")

Hi Roniel, To return something instead of printing it use:

return "You're doing a great job, Jacinta"