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

Stephen Bone
Stephen Bone
12,359 Points

Is there an issue with the checking mechanism on this challenge?

When adding the Docstring an error is received stating the message below:

Bummer! 'NoneType' object has no attribute 'lower'

As there is no lower method called anywhere in the provided code I'm assuming this is an error with the marking system?

All of the code is below just in case I'm doing something insanely stupid.

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

Sorry I was working on the code getting the code in but was having some weird things with that too (as mentioned above), again unless I'm just being stupid!

Stephen Bone
Stephen Bone
12,359 Points

I have just realised that I may be putting the Docstring in the wrong place but I can't test this as it just keeps throwing up There was a communication problem at the minute and asking to restart the challenge. I'll test it again in a little while.

See this thread for posting code in the forums: https://teamtreehouse.com/forum/posting-code-to-the-forum

The greater than symbol is used in markdown to create block quotes.

Stephen Bone
Stephen Bone
12,359 Points

Ah yes stupidity again, maybe I should just call it a night.

Thanks for sorting it out.

3 Answers

Hi Stephen,

Yes, you are putting it in the wrong place.

You're putting it in the class but it wants you to add it to the Treehouse.student method.

Stephen Bone
Stephen Bone
12,359 Points

Hi Jason

Yeah thanks for taking the time to answer anyway.

I've marked both mine & yours up only because I mentioned the returned error wasn't very helpful and (a) hoped someone who could change that might see it and (b) perhaps a reminder for us all Always read the question carefully Haha! :)

Kenneth Love Is there any way to get a more helpful error message for this type of mistake?

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Jason Anello I sure can (and just did)! Thanks for pointing this out. (Check your badges for something special)

Stephen Bone
Stephen Bone
12,359 Points

Wow! I wasn't expecting such a quick resolution to this.

I haven't played with it yet but thanks for the update.

Thanks Kenneth!

The new error message looks really helpful.

Stephen Bone
Stephen Bone
12,359 Points

Insanely stupid I am!

As I mentioned in the comments I realised I was putting the Docstring in the wrong place.

A more helpful error message would have been good to point me in the right direction however as I ended up getting hung up on the error rather than going back and reading through the question again.

I was able to complete the challenge with no issues, but as Stone Preston said, without your code, there's no way we can help.