Python Python Basics Functions and Looping Raise an Exception

Redon Kalemaj
Redon Kalemaj
912 Points

I do not understand what i am supposed to do, and what i am doing wrong

suggestinator.py
def suggest(product_idea):
    if product_idea < "3":
        raise ValueError("Are you sure you don't get it?")
    return product_idea + "inator"

1 Answer

Robin Goyal
Robin Goyal
4,568 Points

You're on the right track! You have to check if the length of the product_idea (string data type) is less than 3 characters. You can use the built in len function to check the length of strings.