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 trialGeorge Lugo
Python Web Development Techdegree Student 922 Pointswhat am i doing wrong for this problem
def just_right("string"): if len("string") < 5: return "Your string is too short". if len("string") > 5: return "Your string is too long". else: return True
def just_right("string"):
if len("string") < 5:
return "Your string is too short".
if len("string") > 5:
return "Your string is too long".
else:
return True
1 Answer
Alexander Davison
65,469 PointsJust a couple minor problems mainly causing Syntax Errors.
- You can't use quotes for parameter names. Python will cause a Syntax Error because it isn't a valid variable name.
- You have periods at the end of some of the statements and Python will cause a Syntax Error if you have periods.
- You shouldn't print anything; wherever you are printing things, you should return it.
I hope this helps. ~Alex
If you continue to fail, please respond. Also, if your question is answered, please post below & provide a best answer so that this question gets a "Check mark" next to this question in the Community.