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

Jesse Sloan
Jesse Sloan
1,972 Points

just_right code challenge is misleading.

So I wrote this:

def just_right(word):
    if len(word) < 5:
        print("Your string is too short.")
    elif len(word) > 5:
        print("Your string is too long.")
    else:
        #return True
        print("exact")

just_right("Jesse")

I kept getting BUMMER crap in spite of the fact that the code i wrote actually works.

The answer was

def just_right(word):
    if len(word) < 5:
        return("Your string is too short.")
    elif len(word) > 5:
        return("Your string is too long.")
    else:
        #return True
        print("exact")

just_right("Jesse")

So the difference was simply that the checker was looking for "return" instead of "print". The problem I have with this is that the way the challenges are worded is always a bit vague and open to interpretation. Even that is OK to a point. I get forcing a student to figure things out on their own.

What I absolutely despise are the cryptic and positively uninformative responses the checker gives. "Bummmer" is just stupid. TELL ME WHAT EXACTLY IS WRONG! I don't have time for games.

Am I the only student on this site who is frustrated by this?

MODERATOR EDITED: Added Markdown to the code snippets so that they are readable in the Community. Please refer to the Markdown CheatSheet for instruction on how to properly post code in the Community.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Jesse,

I get the frustration that sometimes the Bummer messages are not pointing out what is exactly wrong, but that is what it's going to be like in real-life coding experiences. Your program will crash, and there will be no 'code checker' to tell you "exactly" what is wrong. So, you go through your code line-by-line until it gets figured out. If the checker told you exactly what is wrong, the learning experience and retention of information taught here will be drastically reduced. The way the challenges are set up, it teaches you how to troubleshoot, maybe makes you watch the video again (because something was missed or not grasped the first time around), or you end up doing some research, either here in Treehouse's Community or on Google (Trust me... Google will be your best friend when coding).

As for the example you provided, I'm not sure how you find the instructions unclear or "misleading"? The instructions very clearly and explicitly ask you to return the string. Nowhere does it ask to print the string. In code, the "Return" statement and the "Print" statement are two very different things.

Coding is very specific and detailed oriented. So, I am sorry you are having problems, but you will see that in the long run, all aspects of Treehouse are purposefully set up in its particular way to give the most benefit to its students. When I first began, I struggled, but soon learned how specific and picky coding really is. You miss one thing (like a semicolon) or misread one word in a prospects instructions and your code is broken.

I hope everything finds its way for you. :)

Keep Coding! :dizzy: