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 trialMohsan Chaudhry
1,469 PointsAm I supposed to generate strings of variable length to test?
Not sure what I'm doing wrong. Am I supposed to generate strings of variable lengths?
Any help would be appreciated.
import random, string
def just_right(string):
if len(string) > 5:
print ('Your string is too long')
elif len(string) < 5:
print ('your string is too short')
else:
return True
1 Answer
Steven Parker
231,269 Pointspoint_right: The challenge asks you to return one of three possible results.
You will not need to print anything. Just return the strings and you should pass the challenge.
Also, while it doesn't affect passing he challenge, I noticed these minor issues:
- the indentation is not consistent, the first stop is twice as wide as the next
- you don't need to import anything for this challenge
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsYou forgot to put an extra colon in front of point_right:
Just a little note