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 Write Better Python Cleaner Code Docstrings

write better python

Challenge Task 2 of 2

Add a docstring to Treehouse. Should be "Methods related to Treehouse and students.".

class Treehouse:

    def student(self, name):
    '''Gives a pleasant message about the student.'''
    return '{} is a great Treehouse student!'.format(name)

class Treehouse:
  def student(self, name):
      '''Methods related to Treehouse and students.'''
    return '{} is a great Treehouse student!'.format(name)

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,624 Points

Hey there,

I feel you may have got a bit off track with the instructions. Task two just wants you to add a docstring to the Treehouse class, but you seemed to have added a duplicate Treehouse class and added the docstring to student method inside of the duplicate instead of to the class?

First, you will need to delete the entire duplicate method (you can't have two methods with the same name anyway), and then just add the required docstring for Task 2 to the class (the same way you added Task one's docstring to the method).

Keep Coding! :)