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 Python Basics (2015) Number Game App String length

Laurens Sandt
Laurens Sandt
3,513 Points

I have no idea how to finish this. You should give tests to pass

Just no idea what you want. The function is easy to write but apperently it doesn't pass your test. Which is complicated to figure out if I don't know which test you use.

strlen.py

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I feel like there might be some misunderstanding of the instructions. The challenge is explicitly testing the length of the string being sent to it. Here's a quote from the challenge:

If the length of the string is less than five characters, return "Your string is too short". If the string is longer than five characters, return "Your string is too long".

So if the string that they send (and the challenge says the function should accept a string) is less than 5 characters use return to return the string "Your string is too short". If it's greater than 5 characters then return "Your string is too long" . Otherwise, you should return True.

I hope these hints will help! Please let us know if you need further assistance :sparkles: