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

Raise a ValueError

I don't know what's missing here.

suggestinator.py
def suggest(product_idea):
    if len(product_idea) < 3:
        raise ValueError("Your idea is less than 3 characters long")
    return product_idea + "inator"

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Mustapha,

You're not missing anything. The code is correct.
I copy / pasted your code above into the challenge and it passed. There may have just been a temporary glitch in the code checker. Just copy your code above and paste into a fresh challenge.

Just a quick note: Challenges are very picky and very specific. While it doesn't affect the outcome for this particular challenge, you added more than what was asked for. Here the instructions did not ask for any value being passed to the ValueError(). There will be challenges that if you add something not asked for, the challenge will fail even if the code is correct.

Nice work! :) :dizzy:

Thanks, I thought I was going crazy there for a second. I appreciate all the help.

Thanks I am having the same issue with

def suggest(product_idea): if len(product_idea) < 3: raise ValueError("Product idea is too short") return product_idea + "inator"

Stephen Cole
Stephen Cole
Courses Plus Student 15,809 Points

What's the exact error?

If you add three backticks in a row (`) and the word python, the post will be formatted correctly.

def suggest(product_idea): 
    if len(product_idea) < 3: 
        raise ValueError("Product idea is too short") 
    return product_idea + "inator"