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 trialD Elis
13,571 PointsPython Basics- Exceptions
I have the following code for a code program from one of the code challenges in Python Basics:
def suggest(product_idea): if len(product_idea) <= 3: raise ValueError("Product ideas are too short") return product_idea + "inator"
There were some answered questions on the Treehouse Community forum regarding this topic.. but when I tried using the code from the answered questions.. I still get this error message: Bummer: Oh no, There were 2 problems with your code, click the preview pane for more information
Can someone please help out?
def suggest(product_idea):
if len(product_idea) <= 3:
raise ValueError("Product ideas are too short")
return product_idea + "inator"
suggest(dog)
D Elis
13,571 PointsThanks Vasanthakumar⦠but I tried typing suggest("dog") and I stil get the same error
Vasanthakumar V
13,155 Pointsremove suggest("dog") and make the submission, it passes
1 Answer
Esmelin Lopez
10,418 Pointsit less than not less than and equal to. so just remove <= and put < should make it work
Vasanthakumar V
13,155 PointsVasanthakumar V
13,155 PointsI think the error might be because you are missing quotes for your argument in the function call