Python Python Basics All Together Now The Project

Kelly Pellas
Kelly Pellas
681 Points

My code for the suggestion task works in my editor but not the one in the course. I'm not sure what to do?

Here's the code that works:

def suggest(product_idea): return product_idea + "inator"

product_idea = input("What is your product idea? ") try: if len(product_idea) <= 3: raise ValueError("The name is too short!") except ValueError as err: print("Oh no, {} Please try again.".format(err)) else:
suggestion = suggest(product_idea) print(suggestion)

1 Answer

Before I try to help, can you confirm

def suggest(product_idea): 
    return product_idea + "inator"

product_idea = input("What is your product idea? ") 
try: 
    if len(product_idea) <= 3: 
        raise ValueError("The name is too short!") 
except ValueError as err:

    print("Oh no, {} Please try again.".format(err))

    else:
        suggestion = suggest(product_idea) 
print(suggestion)

ā˜ Is this how your code should look?