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

Unable to pass 2/3 test cases

My code is unable to pass 2 of the test cases, i am stuck here, i don't know where am i going wrong.

suggestinator.py
def suggest(product_idea):
    if(len(product_idea) < 3):
        raise ValueError
    return product_idea + "inator"

product_idea = input()
suggest(product_idea)
Podrig Leoghain
Podrig Leoghain
5,094 Points

Please also paste the challenge instructions in to your question.

Steven Parker
Steven Parker
229,644 Points

Podrig, you can always use the "View Challenge" button in the upper right to see the instructions.

1 Answer

Steven Parker
Steven Parker
229,644 Points

To complete the challenge, you only need to modify the function code. You don't need to create a new variable, call "input", or call the function itself. Doing things other than what the instructions ask for can confuse the validation mechanism.

Remove those two lines from the bottom and you'll pass the challenge.