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 trialDavid Garcia
Python Development Techdegree Graduate 11,254 PointsI don't understand what it wants me to do i've tried everything i thought of..i think it might be in the Try function
i did every thing i thought of help
def suggest(product_idea):
if product_idea <= 3:
raise ValueError("your product idea has less than 3 characters in it")
return product_idea + "inator"
try:
except ValueError as err:
print("({})".format(err))
1 Answer
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsThe function looks almost okay, the only mistake is that you should check if it's less than 3 and NOT less than OR equal to 3 :-)
def suggest(product_idea):
if product_idea <= 3: # should be < 3
raise ValueError("your product idea has less than 3 characters in it")
return product_idea + "inator"
David Garcia
Python Development Techdegree Graduate 11,254 PointsDavid Garcia
Python Development Techdegree Graduate 11,254 Pointsthanks for the help but i am still having trouble it wants me to do something else and i cant put my hand on it, ill be messing with it some more to see if i can do it
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsHenrik Christensen
Python Web Development Techdegree Student 38,322 PointsSorry, didn't see the if the product_idea is less than 3 characters long part - this mean you should do
if len(product_idea < 3: