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 trialVehid Metovic
10,117 PointsDoes not accept my code
My code seems to work but the corrector doesn't accept it.
def just_right(string) :
if len(string)<5 :
print("Your string is too short")
elif len(string)>5 :
print("Your string is too long")
else :
return True
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! The challenge asks you to return the strings, but you're printing the strings. Try again after changing your print
statements to return
statements.
Hope this helps!
Samuel Ferree
31,722 PointsYour code is functional, and has the right idea, but if I remember correctly, the challenge asks you to return the strings about being too short, or too long. Not print them. For example:
if len(string) < 5:
return "Your string is too short"
Also double check casing and punctuation, not sure how picky the challenge engine is.
Ludovic Dumas
12,245 PointsLudovic Dumas
12,245 PointsThank you I was also stuck for the same reason.