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 trialShashi Kumar
694 Pointsregarding challenge task
why is it saying just_right not returning right value
def just_right(n):
if(len(n)<5):
return('Your string is too short')
elif(len(n)>5):
return('Your string is too long')
else:
return('True')
1 Answer
Steven Parker
231,269 PointsYou want the value True instead of the string 'True', as Afloarei suggested. The parentheses don't actually cause a problem but they are not necessary, since "return" is not a function (unlike "print").
Afloarei Andrei
5,163 PointsAfloarei Andrei
5,163 Pointsreturn True In the 'else' block remove the () and the ''