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

Python OOP - Couldn't find class.

Hi there,

Any idea what the issue is here? It works in a 3rd-party compiler...

Random secondary question: When creating an instance, why is it necessary to include brackets? Seems counter-intuitive since the class name doesn't use brackets and it's not a function...

person = Student() <---

Thanks in advance!

class Student:
    name = "John"

    def praise(self):
        print("Great work, {}!".format(self.name))

person = Student()

2 Answers

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Your issue is that you are doing a print when then challenge is asking you to do a return.

On the brackets - not really sure but if you are created a derived class you use brackets and often you will be passing some arguments to the class at instantiation.

Thanks, Dave!