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 trialJames Koki
1,333 Pointssuggestinator.py sorry I'm stuck again.
def suggest(product_idea):
return product_idea + "inator"
if product_idea < len(3):
raise ValueError("Is your product idea only 3 characters long?")
1 Answer
Steven Parker
231,268 PointsYou've got the right idea, but there are a few issues:
- all code in a function must be indented
- the conditional code must be done before the
return
- compare the length of the argument to 3, instead of the argument to the length of 3
Pratham Mishra
14,191 PointsPratham Mishra
14,191 Pointscheck the condition first, in the condition block raise the ValueError and then return the final string.