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

Peter Braswell
PLUS
Peter Braswell
Courses Plus Student 1,507 Points

just_right task, this should work? What am I missing?

I tested this in a workspace, I learned my lesson yesterday. This works but the check in the coding assignment keeps giving me "Bummer!, Try again".

It would be really helpful if there were some feedback on what the check thinks is wrong. It's frustrating otherwise.

strlen.py
def just_right(mystring):
    if len(mystring) < 5:
        print("Your string is too short")
    elif len(mystring) > 5:
        print("Your string is too long")
    else:
        return True

2 Answers

Steven Parker
Steven Parker
231,271 Points

In this challenge, your function should return one of several results. And you won't need to print anything.

This was my issue. Thanks.

I got the same error and I agreed that it is frustrating to get the error but not knowing which part causes the error.