Welcome to the Treehouse Community
Looking to learn something new?
What's wrong with my code?
I didn't understand the instructions too well, but this is what I did and it did not work
def just_right(string): string = input() if len(string) > 5: print("Your string is too long") elif len(string) < 5: print("Your string is too short") else: return True
Haider AliPython Development Techdegree Graduate 24,724 Points
Hi, there are a few things wrong with your code. Firstly, for this code challenge, input from the user is not required. Also, instead of returning the specified phrases, you have printed them. Here is what your code should look like:
def just_right(string): if len(string) > 5: return "Your string is too long" elif len(string) < 5: return "Your string is too short" else: return True