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 trialJim Garman
Python Web Development Techdegree Student 1,716 Pointsjust_right not quite right
Challenge code Gods are telling me this is not returning the correct answer, but I can't figure out why.
def just_right(test):
if len(test) < 5:
return "Your string is too short."
elif len(test) > 5:
return "Your string is too short."
else:
return True
2 Answers
Rich Zimmerman
24,063 PointsLooks like it's just a matter of having the same string for both conditions: "Your string is too short."
Gustavo Winter
Courses Plus Student 27,382 PointsHi, the problem is you repeat the same setence for the two condition.
Check this, you will find the answer:
def just_right(test):
if len(test) < 5:
return "Your string is too short"
elif len(test) > 5:
return "Your string is too long"
else:
return True
Jim Garman
Python Web Development Techdegree Student 1,716 PointsMy goodness, thank you!
Jim Garman
Python Web Development Techdegree Student 1,716 PointsJim Garman
Python Web Development Techdegree Student 1,716 PointsMy goodness, thank you!