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 trialGreg Isaacson
Courses Plus Student 702 PointsA little stuck...
Hi All,
Im a bit stuck...I have the feeling im close...
So the question is asking me to RETURN either your string is too high or too low.
I have done an if statement:
if len(just_right) < 5: #Setting up a condition
If the condition is true, then return("Your string is too small")
Then I do the inverse in the next statement.
And then I return true??
Any idea where im going wrong?
def just_right(str):
if len(just_right) < 5:
return("Your String is too short")
elif len(just_right) > 5:
return ("Your string is too long")
else:
return True
2 Answers
João Elvas
5,400 PointsSo I can give you the answer, but you get much more self fulfilment if you do it yourself.
I will give you an hint
"You are comparing the function and not the arg."
If you still cant do it, I will give you the answer.
(Plus: you are not reading the exercise correctly because I think you probably have to do the inverse of "<" and that is ">=", just another hint! :p)
Greg Isaacson
Courses Plus Student 702 PointsThanks...it worked:)