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

regarding challenge task

why is it saying just_right not returning right value

strlen.py
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')
Afloarei Andrei
Afloarei Andrei
5,163 Points

return True In the 'else' block remove the () and the ''

1 Answer

Steven Parker
Steven Parker
229,670 Points

You 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").