Python Python Basics Functions and Looping Raise an Exception

Dominic Eve
Dominic Eve
232 Points

What is wrong with this code?

def suggest(product_idea): return product_idea + "inator" test characters = len(product_idea)

if characters >=

suggestinator.py
def suggest(product_idea):
    return product_idea + "inator"
test
characters = len(product_idea)

if
    characters >= 3
    raise ValueError 

1 Answer

Rick Gleitz
Rick Gleitz
41,835 Points

Hi Dominic,

You're on the right track, just a matter of proper formatting and a few other things.

First, put everything between the two statements the challenge gave you. In other words, the return comes at the end. Also indent everything properly. The test line is not needed. And the last things I see are that your if statement is not on one line and you have >= (which is greater than or equal to), you need < (less than).

Hope this helps!