Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!

first_class.py
class Student:
    name = "John"

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

person = Student()
person.praise()

2 Answers

Dave StSomeWhere
Dave StSomeWhere
19,822 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!