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 trial

Python Python Basics Functions and Looping Raise an Exception

Python 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?

suggestinator.py
def suggest(product_idea):
    if len(product_idea) <= 3:
        raise ValueError("Product ideas are too short")
    return product_idea + "inator"

suggest(dog)
Vasanthakumar V
Vasanthakumar V
13,155 Points

I think the error might be because you are missing quotes for your argument in the function call

Thanks Vasanthakumar… but I tried typing suggest("dog") and I stil get the same error

Vasanthakumar V
Vasanthakumar V
13,155 Points

remove suggest("dog") and make the submission, it passes

1 Answer

Esmelin Lopez
Esmelin Lopez
10,418 Points

it less than not less than and equal to. so just remove <= and put < should make it work