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 trialKeaton Adams
Courses Plus Student 449 PointsHi team, should I be adding a "try" ?
See above
def suggest(product_idea):
if number_of_characters < 3:
raise ValueError("More than 3 characters needed")
return product_idea + "More than 3 characters needed"
3 Answers
Haisam Elkewidy
26,987 PointsYou need to use the len() function. So it would be something like this:
if len(product_idea) < 3: raise ValueError("whatever you want here")
Haisam Elkewidy
26,987 PointsYour return statement should be:
return product_idea + "inator"
Because in the console it's expecting a concatenation of the idea name with the inator suffix at the end.
For example: "bacon" + "inator" = "baconinator".
Try this:
def suggest(product_idea): if len(product_idea) < 3: raise ValueError("Need more characters")
return product_idea + "inator"
Keaton Adams
Courses Plus Student 449 PointsPerfect thank you! I must have been missing that inator was a suffix term.
Haisam Elkewidy
26,987 PointsIf any of my answers helped you solve your problem, please consider clicking on the upper arrows and giving me points for Best Answer.
Keaton Adams
Courses Plus Student 449 PointsKeaton Adams
Courses Plus Student 449 PointsHi Haisam, Thanks for the help. I tried (below) and it did not work. I often feel like I am missing most obvious things.
def suggest(product_idea): if len(product_idea) < 3: raise ValueError("Need more characters") return product_idea + "Need more characters"