Python Python Basics Functions and Looping Raise an Exception

How do you coerce an int into a string?

I need to keep the user from entering less than 3 characters

I tried <char(3) but didn't work

suggestinator.py
def suggest(product_idea):
    if product_idea <3:
        raise ValueError
    return product_idea + "inator"

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
52,670 Points

You need to find the number of characters in product_idea and compare that to the number 3. For this you can use the len() method as shown here.