Python Python Basics Functions and Looping Raise an Exception

Blue DiamondXD
Blue DiamondXD
2,345 Points

i dont know what is missing!

suggestinator.py
def suggest(product_idea):
    if product_idea != "yes":
        raise ValueError("")
    return product_idea + "inator"

3 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 47,493 Points

The challenge asks you to raise a value error if the length of product_idea is less than 3. You are raising a value error if product_idea doesn't equal "yes".

Blue DiamondXD
Blue DiamondXD
2,345 Points

so i need to replace it with a 3 o len(3)

adrian miranda
adrian miranda
10,604 Points

You want to check how long the product_idea is. To check how long it is, you can say len(product_idea)

And then you would check to see if it is less than 3.

Blue DiamondXD
Blue DiamondXD
2,345 Points

so it will be like seggest = len(product_idea) ???

adrian miranda
adrian miranda
10,604 Points

How about:

if len(product_idea) < 3:

Blue DiamondXD
Blue DiamondXD
2,345 Points

ohhhhh i dont know you can do that........ thanks!