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 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.".

starter.py
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
MOD
Jason Anders
Treehouse Moderator 145,860 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! :)

:dizzy: