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!
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 trial
Christiian Allen
Courses Plus Student 859 PointsI don't know whats wrong with this . please help?
def suggest(product_idea): return product_idea + "inator" if len(product_idea) < 3: raise ValueError
Why does this not work? It gives off error messages? Not sure what to do.
5 Answers

Adam N
70,278 PointsBased on what you've posted, it looks like your code is returning the idea string regardless of what length it is. The function should first check the length of the product_idea, and only return the string if the if statement does not evaluate to true.
Let me know if this helps here

Josh Keenan
19,649 PointsWhat challenge is this for?

Alexander Besse
Full Stack JavaScript Techdegree Graduate 35,115 PointsPlease go into the challenge this is for, click "Get Help" and make sure the "Share code" checkbox is marked. This will help us a lot, so we can help you. :)

Haisam Elkewidy
26,987 PointsYou need to put the if statement before this line:
return product_idea + "inator"
Because otherwise, it will just return a string regardless of the length. Code is being read from top to bottom.

Christiian Allen
Courses Plus Student 859 PointsI appreciate all the help but it just will not play through. I don't know if it's me or what? I have done fine up to this point it just will not work. Thank you for all the help.