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

EOF error that I can't see the error

Hello. I'm trying to figure out what's wrong with this code. The preview says I have an EOF error on line 6. I've looked up and down the code and I don't know why it has this error. Quotes are fine I think and parenthesis. Any help would be great.

suggestinator.py
def suggest(product_idea):
    if product_idea < str (3):
        raise ValueError ("Make a product idea that is more than 3 characters long")
    return product_idea + "inator"
try:
    idea = input ("Type your product idea:  ")
    together = suggest (idea)
except ValueError as err:
    print ("{}".format(err))
print (together)

1 Answer

Steven Parker
Steven Parker
231,248 Points

You're working too hard! The instructions aren't asking you to write a program to take input and process it, or to handle exceptions.

All you need for this challenge is to test the size of the argument and raise the error if it is too short. You'll probably need to add just 2 lines of code.

Oh I see. I started over and figured it out. I was trying too hard. Thanks.